If you are working from a master assembly try this rule, I have not tried it, but I think it should work.
Keep in mind that it will return error if there is no "POS" property in the part.
Dim oFace As FaceProxy = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFacePlanarFilter, "Select Face")
If oFace Is Nothing Then Exit Sub
Dim oOcc As ComponentOccurrence = oFace.ContainingOccurrence
oOcc.Edit
Dim doc As PartDocument = oFace.NativeObject.Parent.Parent.document
Dim oPath As String = Left(doc.FullFileName, (InStrRev(doc.FullFileName, "\", -1, vbTextCompare)))
Dim My_Prop As String = doc.PropertySets.Item("Inventor User Defined Properties").Item("POS").Value
Dim oFilename As String = oPath & My_Prop & ".dxf"
Dim oCommand As CommandManager
oCommand = ThisApplication.CommandManager
oCommand.DoSelect(oFace)'Select face
oCommand.PostPrivateEvent(PrivateEventTypeEnum.kFileNameEvent,oFilename)
oCommand.ControlDefinitions.Item("GeomToDXFCommand").Execute2(True)
oOcc.ExitEdit(63747)
I hope I help you with your problem. regards
Please accept as solution and give likes if applicable.
I am attaching my Upwork profile for specific queries.
Sergio Daniel Suarez
Mechanical Designer
| Upwork Profile | LinkedIn