- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, I am having an issue finding the native face or edge object from a Weldment assembly if the weldment has machining features present. If no machining features are present then it works fine. It makes sense as the machining would create an alternative body that is represented in the assembly and which is different to the original part surface body. How do I translate the selected face or edge (or any object for that matter) to the relevant part face or edge?
In this case, I have the user select a Planar face at assembly level. The app must then find the face in the part document and create a part sketch.
As I said this works in a normal assembly or a Weldment with no machining features on the part. As soon as any features are present the sketch creation fails.
My simplified code:
Dim oAssyDoc As AssemblyDocument = oApp.ActiveDocument
Dim oFaceProxy As FaceProxy = oApp.CommandManager.Pick(SelectionFilterEnum.kPartFacePlanarFilter, "Select Planar Face")
Dim oOccurrence As ComponentOccurrence = oFaceProxy.ContainingOccurrence
Dim oPartDoc As Inventor.PartDocument = oOccurrence.ReferencedDocumentDescriptor.ReferencedDocument
Dim oPartCompdef As Inventor.PartComponentDefinition = oPartDoc.ComponentDefinition
Dim oSketch As PlanarSketch = oPartCompdef.Sketches.Add(oFaceProxy.NativeObject)
Solved! Go to Solution.