Hi,
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.ComponentDefinition
Dim oDoc As Inventor.Document = oPartCompDef.Document
Dim oOcc As Inventor.ComponentOccurrence = ..........?
Geert
Solved! Go to Solution.
Solved by xiaodong_liang. Go to Solution.
I could find it by query the ComponentOccurrences of the assembly by:
Dim oOcc As Inventor.ComponentOccurrence = Nothing
For Each oOcc In oAsmCompDef.Occurrences
If oOcc.Definition Is oPartCompDef Then Exit For
Next
Is there a direct solution without Quering?
Geert
Hi,
The selected edge in assembly context is proxy edge. EdgeProxy.ContainingOccurrence returns the ComponentOccurrence that the native object is being referenced through