Analyze and Print Assembly Structure
The WALK ASSEMBLY program analyzes the products, shape representations, and relations in a STEP file to identify assembly structures. Once the structures have been identified, the program walks the structure printing a description of the key objects.
Assemblies are probably the most complex structure in STEP data sets. To process them correctly, you must look at relationships between products and relationships between shapes, watch for two different ways of describing placement of components (mapped item and context dependent shape reps), and resolve other indirections.
This sample program uses assembly extension functions to identify the assembly structures and annotate the STEP data with backpointers to all the relevant pieces of an assembly.The stix_asm_tag function builds an index on the assembly data.
class StixMgrAsmProduct ==> on product_definition class StixMgrAsmShapeRep ==> on shape_representation class StixMgrAsmRelation ==> on shape_representation_relationship or mapped_item
Each of these contains arrays of backpointers, flags, and other information. Each also defines a static find() function that you can use to retrieve the manager for a given object
stp_product_definition * pdef StixMgrAsmProduct * mgr; // retrieve assembly backpointers for product definition obj mgr = StixMgrAsmProduct::find(pdef);
Run the walkasm program on the command line. The sample dataset walkasm_in.stp contains assemblies. The walkasm program prints an indented list showing all of the assembly structures. The sample report output is shown in the file walkasm_out.txt.