hm_hierarchy

Returns the hierarchical structure of assemblies, components and multibodies, along with properties, materials, groups and beamsection collectors.

Syntax

hm_hierarchy name_or_id

Type

HyperMesh Tcl Query

Description

Returns the hierarchical structure of assemblies, components and multibodies, along with properties, materials, groups and beamsection collectors.

The returned list contains entries of the form: {root name_or_id entity_type list_of_children_indices}. There is an entry for each supported entity.

The root value is returned as 1 for entities at the root (top) of the hierarchy, or 0 otherwise. Only assemblies, components and multibodies have a hierarchy and have the possibility of returning 1.

The name_or_id value is the name or ID of the entity. This is controlled by the name_or_id option.

The entity_type value is the type of entity from the list of supported entities.

The list_of_children_indices value is a list of indices of the children of the entity. The indices refer to the location of the entity in the returned list. The indices are 0 based. Only assemblies can return a non-empty list if they have children.

Inputs

name_or_id
The string "name" if the list is to be returned using entity names, or "id" if the list is to be returned using entity IDs.

Example

To find the hierarchy for the following structure of assemblies and components:


Figure 1.
hm_hierarchy name

{0 Part1 components {}} {0 base assemblies 0} {0 Part2 components {}} {0 attachments assemblies 2} {1 wheel assemblies {1 3}} {0 Part3 components {}} {1 head assemblies 5} {1 empty assemblies {}} {1 Part4 components {}} {4 6 7 8}

Errors

Incorrect usage results in a Tcl error. To detect errors, you can use the catch command:
if { [ catch {command_name...} ] } {
   # Handle error
}