Created
October 14, 2025 10:35
-
-
Save stephensmitchell/a9cf834ba621aa2417d5f32addfa2802 to your computer and use it in GitHub Desktop.
List All Parts in an Assembly and Sub Assemblies
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
| #https://help.alibre.com/articles/#!alibre-help-v28/list-all-parts-in-an-assembly-and-sub-assemblies | |
| # list all the parts in an assembly and it's sub-assemblies | |
| def ListPartsinAssembly(Assem): | |
| for P in Assem.Parts: | |
| print '%s in %s' % (P, Assem) | |
| for SA in Assem.SubAssemblies: | |
| ListPartsinAssembly(SA) | |
| # top-level assembly, replace with your own path | |
| Assem = Assembly(r'C:\Users\<username>\Downloads\ASM', 'Main ASM.AD_ASM') | |
| ListPartsinAssembly(Assem) | |
| Assem.Close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment