Hello,
I am running a program using AlibreX that uses the root occurrence of an assembly session to read all of the design sessions and occurrences. However, there are suppressed parts in some assemblies that I do not want to read and iterate through. Does anybody know a way to read the design sessions and occurrences of only the parts and assemblies that are unsuppressed?
Alternatively, is there a way to ignore a design session altogether given a condition when looping through the occurrences? I was thinking of a hashmap but I'm not so sure...
Here's an example of my code that prints the names of all the design sessions. Assume all imports.
I am running a program using AlibreX that uses the root occurrence of an assembly session to read all of the design sessions and occurrences. However, there are suppressed parts in some assemblies that I do not want to read and iterate through. Does anybody know a way to read the design sessions and occurrences of only the parts and assemblies that are unsuppressed?
Alternatively, is there a way to ignore a design session altogether given a condition when looping through the occurrences? I was thinking of a hashmap but I'm not so sure...
Here's an example of my code that prints the names of all the design sessions. Assume all imports.
Code:
alibre = Marshal.GetActiveObject("AlibreX.AutomationHook")
root = alibre.Root
session = root.TopmostSession
assembly_session = session
root_ocurrence = assembly_session.RootOccurrence
occurrences = root_occurrence.Occurrences
for i in range(occurrences.Count):
print(occurrences.Item(i).DesignSession.Name) #prints the name of all design sessions in the assembly