Path to a element and a part underneath it of a component pattern

Path to a element and a part underneath it of a component pattern

Anonymous
Not applicable
296 Views
1 Reply
Message 1 of 2

Path to a element and a part underneath it of a component pattern

Anonymous
Not applicable

Hello

 

I would like to know if it is possible to map the path to a part that is under a element of a Component Pattern. The reason for this is so that I can suppress and unsuppress features of that part and not change the other parts in the pattern.

0 Likes
297 Views
1 Reply
Reply (1)
Message 2 of 2

JamieVJohnson2
Collaborator
Collaborator
Public Function FindOccurrencesFromPattern(bn As BrowserNode) As List(Of ComponentOccurrence)
    Dim ocs As New List(Of ComponentOccurrence)
    Dim oPat As OccurrencePattern = bn.NativeObject
    For Each oce As OccurrencePatternElement In oPat.OccurrencePatternElements
        For Each co As ComponentOccurrence In oce.Occurrences
            ocs.Add(co)
        Next
    Next
    Return ocs
End Function

This is a routine that gets the components out of a component pattern's browser node.  Note the OccurrencePattern object (component pattern).  It contains all the elements which contain either more occurrencePatterns, or ComponentOccurrences (aka your part).  Each item in an assembly is a ComponentOccurrence (aka the visual occurrence of another file).  Your key part will need something for you to identify it with when you are browsing all the ComponentOccurrences (filename, part number, secret custom key, whatever).  Suggest you study the Inventor API reference tree file found in the SDK to see a big map of item relationships within the Inventor API engine, but not too hard, it could hurt ones head.Smiley Very Happy

Jamie Johnson : Owner / Sisu Lissom, LLC https://sisulissom.com/
0 Likes