03-01-2018
02:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
03-01-2018
02:33 AM
Try the following VBA code to get specific occurrence of ModelLeaderNote.
Sub Main()
Dim oDoc As AssemblyDocument
Set oDoc = ThisApplication.ActiveDocument
Dim oDef As AssemblyComponentDefinition
Set oDef = oDoc.ComponentDefinition
Dim oNotes As ModelLeaderNote
For Each oNotes In oDef.ModelAnnotations.ModelLeaderNotes
Dim oBody As SurfaceBody
Set oBody = oNotes.Definition.Intent.Geometry.Parent
Dim occ As ComponentOccurrence
For Each occ In oDef.Occurrences.AllLeafOccurrences
Dim occBody As SurfaceBody
For Each occBody In occ.Definition.SurfaceBodies
If oBody Is occBody Then
Debug.Print occ.Name
GoTo NextIteration
End If
Next
Next
NextIteration:
Next
End SubPlease feel free to contact if there is any queries.
If solves problem, click on "Accept as solution" / give a "Kudo".
Thanks and regards,
CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network
