getEntitiesFromSet
Overview
This utility is used for getting the actual entities from the given set. Set name is mandatory input and set type is optional.If same name is defined for different set type (Nodes, shell elements, solid elements, solid element face), then defining the set type will be useful to get the entities from the specified type.
Syntax
Without set type
EntityIdArray=simlab.getEntitiesFromSet('SetName');
With set type
EntityIdArray=simlab.getEntitiesFromSet('SetName', 'SetType');
where,
- SetType = Node; to get node set entities
- SetType = Shell_Elem; to get shell element set entities
- SetType = Solid_Elem_Face; to get solid element face entities
- SetType = Solid_Elem_Layer; to get solid elements set entities
User Case
- To create the new body for the specified layer of solid elements attached to the face of the parent body
Why we need this utility?
For above case, we will use 'Create body from Solid element' tool to create the new body by giving solid elements in solid element set as input. When we recorded this operation using Project > Record, the solid element Ids will be hardcoded in script. When we use this script for different models, it will fail due to difference in solid element IDs. In order to overcome this, we can make use of this utility to extract the solid elements from solid element set and utilize it for different models.
Utility Input/output
Without set type
With set type
Hint
After extracting the Entity ids, convert it as a string by adding "str" and remove the () using ".strip" and store it in a variable for ease of use.Entity_Id=str(Entity_Id).strip("()")