Export Extracted Face

Hi,

i'm facing a problem with the export option in NXOpen:
I created an non associative "extracted face" from a body.
Now i want to create a new part which only contains this extraced face.
I tried two options but they both don't work:

1. Option:
...
Dim nXObject2 As NXOpen.NXObject
nXObject2 = extractFaceBuilder1.Commit()
Dim Extracted_Face As NXOpen.Features.ExtractFace = Nothing
Extracted_Face = CType(nXObject2, Features.ExtractFace)
Dim BodyTag(0) As Tag
BodyTag(0) = nXObject2.Tag
Dim String_test As String = "D:\00_Database\test_part.prt"
theUFSession.Ps.ExportData(BodyTag, String_test)

2. Option:
...
Dim nXObject2 As NXOpen.NXObject
nXObject2 = extractFaceBuilder1.Commit()
Dim myOptions As UF.UFPart.ExportOptions
myOptions.params_mode = UF.UFPart.ExportParamsMode.MaintainAllParams
myOptions.new_part = True
Dim Name As String = "D:\00_Database\test_part.prt"
Dim BodyTag(0) As Tag
BodyTag(0) = nXObject2.Tag
theUFSession.Part.ExportWithOptions(Name, 1, BodyTag, myOptions)

I hope you can tell me whats my mistake with these options or an third option which works for my problem.

Thanks!

Johannes

The ExtractFaceBuilder's .Commit method will return an extract face feature, not the face that was extracted. To get a reference to the body that was created, you can use the extract face feature's .GetBodies method.

For option 1, the Ps.ExportData function will not let you export a feature; you must export a body object. Also, this method will create a parasolid file, so your export file should have an extension of ".x_t" rather than ".prt".

For option 2, the API reference isn't clear, but I suspect it will also want the tags of geometric objects (bodies, curves, etc) rather than tags of features. If you use the .MaintainAllParams option, the parent body will be exported along with the extracted face.