./features/break down assembly
Download Features Source code Forum Ask for support

Break down assembly onto parts

Analysis Situs is meant for use with individual parts rather than assemblies, but it provides a wide set of commands to bridge that gap. One frequently encountering demand is to extract all unique parts from an assembly

To break down an assembly to a plain list of parts with BOM (bill of materials), use the following script:

# Set working directory to the current one (where app is launched)
set workdir [pwd]

# List all files in the working directory
puts [glob $workdir/*]

# Set working variables.
set basename "assy"
set ext "stp"

# Load the assembly, expand all compound parts and view.
asm-xde-load -model M -filename "$workdir/$basename.$ext"
asm-xde-xcompounds -model M
asm-xde-browse -model M

# Create the target directory for dump.
file mkdir "$workdir/$basename"

# Finally, unload all unique parts.
asm-xde-unload -model M -path "$workdir/$basename"

Alternatively, if you run the command asm-xde-unload without any arguments, it will display a dialog box where you can control the assembly breakdown process. In this window, you have to enter the assembly's input filename and the destination location where all individual parts will be dumped as STEP files. The "expand compound parts" checkbox allows you to turn on and off automatic conversion of compound-type parts into subassemblies. The "use filename prefix" checkbox instructs the algorithm to automatically add the input file's "base name" as a prefix to each result filename.

The exported BOM file contains three columns: part ID, part filename, quantity.