Last active
November 26, 2025 05:21
-
-
Save stephensmitchell/16dd2793b0602d30194aea5cac51e994 to your computer and use it in GitHub Desktop.
Is a component suppressed? Suppression Status Report
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import AlibreScript | |
| from AlibreScript.API import * | |
| Asm = Assembly(CurrentAssembly().Name, False) | |
| Session = AlibreScript.API.Global.Root.TopmostSession | |
| print "Suppression Status: %s\n" % Asm.Name | |
| for item in list(Asm.Parts) + list(Asm.SubAssemblies): | |
| occ = item.GetMappedOccurrence(Session) | |
| print "%s: %s" % (item.Name, "SUPPRESSED" if occ.IsSuppressed else "Active") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import AlibreScript | |
| from AlibreScript.API import * | |
| Win = Windows() | |
| CurrentAssembly = Assembly(CurrentAssembly().Name, False) | |
| print "=" * 50 | |
| print "Suppression Status Report" | |
| print "Assembly: %s" % CurrentAssembly.Name | |
| print "=" * 50 | |
| Root = AlibreScript.API.Global.Root | |
| session = Root.TopmostSession | |
| def get_suppression_status(assembled_item): | |
| try: | |
| occurrence = assembled_item.GetMappedOccurrence(session) | |
| if occurrence is not None: | |
| return occurrence.IsSuppressed | |
| return None | |
| except Exception, ex: | |
| print " Error getting status: %s" % str(ex) | |
| return None | |
| print "\nParts:" | |
| print "-" * 40 | |
| parts = CurrentAssembly.Parts | |
| if len(parts) > 0: | |
| for part in parts: | |
| status = get_suppression_status(part) | |
| if status is not None: | |
| status_text = "SUPPRESSED" if status else "Active" | |
| else: | |
| status_text = "Unknown" | |
| print " %s: %s" % (part.Name, status_text) | |
| else: | |
| print " No parts in assembly" | |
| print "\nSub-Assemblies:" | |
| print "-" * 40 | |
| subassemblies = CurrentAssembly.SubAssemblies | |
| if len(subassemblies) > 0: | |
| for subasm in subassemblies: | |
| status = get_suppression_status(subasm) | |
| if status is not None: | |
| status_text = "SUPPRESSED" if status else "Active" | |
| else: | |
| status_text = "Unknown" | |
| print " %s: %s" % (subasm.Name, status_text) | |
| else: | |
| print " No sub-assemblies" | |
| print "\n" + "=" * 50 | |
| print "Done" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ================================================== | |
| Suppression Status Report | |
| Assembly: assm | |
| ================================================== | |
| Parts: | |
| ---------------------------------------- | |
| pressure_vessel_stress_testing<1>: Active | |
| pressure_vessel_stress_testing<2>: Active | |
| pressure_vessel_stress_testing<3>: SUPPRESSED | |
| pressure_vessel_stress_testing<4>: Active | |
| pressure_vessel_stress_testing<5>: Active | |
| fillet_grouping<1>: SUPPRESSED | |
| RotorDriver<1>: Active | |
| ShinyTop<1>: Active | |
| SmallGear<1>: SUPPRESSED | |
| Spring<1>: Active | |
| Twister<1>: Active | |
| TwisterButton<1>: Active | |
| Sub-Assemblies: | |
| ---------------------------------------- | |
| No sub-assemblies | |
| ================================================== | |
| Done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment