Model.ME_PartsetCreateByAssemblyMark#
- Model.ME_PartsetCreateByAssemblyMark(assemblymarkmask, options)#
Creates a part set per legacy assembly, imitating the legacy assembly hierarchy of the input mark in part set browser. It will also create parts for orphan components which lie directly under the root model under legacy assemblies.
An option to resolve conflicting hierarchy is available. This situation occurs for the parts with multiple components. When two components lie in different assemblies, mapping assemblies to part sets with the same part under different part sets gives you the wrong perception of assembly hierarchy. This conflicting situation is resolved by creating a part for each component and deleting the original part (if empty).
This command has an option to create nested or flat part hierarchy in the Part browser for orphan components under legacy assembly. Nested hierarchy option acts in a similar way to the “Create Parts” option on solver deck import. Flat part hierarchy results in all newly created parts for orphan components being placed directly under the root model in the Part browser.
- Parameters:
assemblymarkmask (Collection) – The collection containing the legacy assemblies.
options (hwString) –
The string containing the options for part set creation. The following options can be defined in the string following <name>=<value> format and separated by space. The order of options does not matter. If an option is not defined in the string, the default value will be used. Valid options are:
parent_partsetid=<value>
The valid ID of the existing part set under which we want to imitate the legacy assembly hierarchy with part set per legacy assembly. Default value is 0.
root_assemblyonly=<value>
The flag to convert or map root assemblies only. Leaf assemblies will be filtered out.
0 - Convert or map all legacy assemblies on mark. (default)
1 - Filter out leaf assemblies. Keep root assemblies (the assemblies with no parent assembly) only to convert or map.
resolve_conflicts=<value>
The flag to resolve conflicts in part and legacy assembly hierarchy.
0 - Do not resolve conflicts in hierarchy. (default)
1 - Resolve conflicts in hierarchy by creating a new part per conflicting component.
skip_mapped=<value>
The flag to skip already converted or mapped legacy assembly to part set.
0 - Map all legacy assemblies by creating a part set per legacy assembly.
1 - Skip already mapped legacy assemblies to avoid duplicate creation of a part set per legacy assembly. (default)
flat_modules=<value>
The flag to create nested or flat parts hierarchy (for orphan components) in part browser.
0 - Do not create flat parts hierarchy (for orphan components) under root model in part browser. Creates nested hierarchy.
1 - Create flat parts hierarchy under root model. All newly created parts will be placed under a root model. (default)
parts_allorphancomps=<value>
The flag to create parts for all the orphan components in the model.
0 - Do not create parts for all the components in the model. Consider components which are under selected assemblies only. (default)
1 - Create parts for all the orphan components in the model.
skip_cardimage_assemblies=<value>
The flag to skip assemblies with card images.
0 - Convert or map all assemblies.
1 - Skip assemblies which have card images. (default)
Example#
Map/convert all legacy assemblies with IDs 7, 8, and 9 under existing part set with ID 1 and skip already mapped assemblies to Part sets with flat parts hierarchy#import hm import hm.entities as ent model = hm.Model() assem_col = hm.Collection(model, ent.Assembly, [7, 8, 9]) model.ME_PartsetCreateByAssemblyMark(assem_col, "parent_partsetid=1 skip_mapped=1 flat_modules=1")