I'm trying to find the ComponentOccurrence in an assembly from a selected edge or face of a Part
Snipset of the code:
Dim oPartCompDef As Inventor.PartComponentDefinition = oFace.Parent.ComponentDefinition
'or oEdge.Parent.ComponentDefinitionDim oDoc As Inventor.Document = oPartCompDef.DocumentDim oOcc As Inventor.ComponentOccurrence = ..........?
Go to Solution.
I could find it by query the ComponentOccurrences of the assembly by:
Dim oOcc As Inventor.ComponentOccurrence = NothingFor Each oOcc In oAsmCompDef.Occurrences If oOcc.Definition Is oPartCompDef Then Exit ForNext
Is there a direct solution without Quering?
The selected edge in assembly context is proxy edge. EdgeProxy.ContainingOccurrence returns the ComponentOccurrence that the native object is being referenced through
I overlooked this one!
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register
Start with some of our most frequented solutions to get help installing your software.