1 Answers
A:
Step-by-Step Strategy
Use MouseEvents.OnMouseClick or a custom command to detect the click location on the sheet.
Perform a hit test on the drawing view to get the selected geometry:
vbnet
Dim oView As DrawingView = ' your selected view
Dim oPoint As Point2d = ThisApplication.TransientGeometry.CreatePoint2d(x, y)
Dim oHitResults As ObjectsEnumerator = oView.HitTest(oPoint, SelectionFilterEnum.kAllEntitiesFilter)
For Each oObj In oHitResults
If TypeOf oObj Is DrawingCurveSegment Then
Dim oCurve As DrawingCurveSegment = oObj
Dim oProxy As Object = oCurve.Parent.Geometry
' Now try to resolve the proxy to a ComponentOccurrence
End If
Next
Use GeometryProxy.ContainingOccurrence to get the ComponentOccurrence:
vbnet
Dim oOcc As ComponentOccurrence = oProxy.ContainingOccurrence
This gives you the actual part or subassembly occurrence in the assembly model.
Autodesk Inventor
AutodeskHelp the community
Be the First to Answer these questions
Disclaimer
Techjockey’s software industry experts offer advice for educational and informational purposes only. A category or product query or issue posted, created, or compiled by Techjockey is not meant to replace your independent judgment.
20,000+ Software Listed
Best
Price Guaranteed
Free Expert
Consultation
2M+
Happy Customers