GiD - The personal pre and post processor

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Current »

Special Tcl commands>Groups>Definition
GiD_Groups create|clone|delete|edit|get|list|window|exists|is_forbidden_name|draw|end_draw

    • GiD_Groups create <group>

To create a new group. <group> must be the full name (e.g. if a group B has as parent A then must use as fullname A//B)

    • GiD_Groups clone <source_group> <destination_group>

create a new cloned group, with the same entities that its source group

    • GiD_Groups delete <group>

To delete a group

    • GiD_Groups edit name|color|opaque|visible|allowed_types|allowed_element_types|parent|state <group> <value>

To modify group properties:

        1. name: change its name
        2. color: set the color to draw its entities (with format #rrggbbaa)
        3. opaque: opaque (1) or transparent (0)
        4. visible: set visibility of its entities. (Visible = 1, Hidden = 0)
        5. allowed_types: set the list type of geometric or mesh entities allowed to be in the group, must be a list with some of {points lines surfaces volumes nodes elements faces}
        6. allowed_element_types: set the list type of mesh elements allowed to be in the group, must be a list with some of {linear triangle quadrilateral, ....}, by default all element types are allowed
        7. parent: to change the parent of a group
        8. state: to change the groups state (normal, disabled or hidden). hidden groups are not listed or visible in windows.
    • GiD_Groups get color|opaque|visible|allowed_types|allowed_element_types|parent|state|num_entities|num_conditions|id|all_properties <group>

To obtain the current value of some property:

        1. num_entities: the total number of geometric or mesh entities that belong to the group
        2. num_conditions: the total number of conditions applied to the group
        3. id: the numeric identifier of the group
        4. all_properties: return a list of property value with the properties of the layer
    • GiD_Groups list ?<parent>?

To get the list of fullnames of the current groups.
If a parent is specified, then only relative names of child groups will be listed. Root parent could be specified with an empty string ""

    • GiD_Groups window open|close|update

Show or hide the groups window or update its content

    • GiD_Groups exists <group>

Return 1 if group exists, 0 else

    • GiD_Groups is_forbidden_name <group>

Return 1 if group name has forbidden syntax

    • GiD_Groups draw {<group_1> ... <group_n>}

Starts drawing the specified groups

    • GiD_Groups end_draw

Finish drawing groups.
Special Tcl commands>Groups>Entities
GiD_EntitiesGroups assign|unassign|get|entity_groups
To handle the entities that belong to groups
Note: GiD_WriteCalculationFile could be interesting to tranverse an print data based on groups without the extra cost of GiD_EntitiesGroups serializing potentially big lists of entities.

    • GiD_EntitiesGroups assign|unassign|get <group> ?-also_lower_entities? <over> <selection>

To add, remove or know entities of a group

      • GiD_EntitiesGroups assign <group> ?-also_lower_entities? <over> <selection>

To assing the selection of entities of kind over to the group
<group> is the full name of the group
<-also_lower_entities> is an optional flag, to select also all lower entities of the selected ones (e.g. curves and points of the selected surfaces)
<over> could be points, lines, surfaces, volumes, nodes, elements, faces, all_geometry, all_mesh
<selection> is a list of integer entity id's starting from 1.
In case of faces it is a list with 2 items, the first is the list of element id's and the second the list of face id's (the local number of the face on the element: a number from 1 to nfaces of the element)
In case of all_geometry is expected a list with 4 items with the list of ids of points, lines, surfaces and volumes.
In case of all_mesh is expected a list with 3 items with the list of ids of nodes, elements and faces, and for faces there are two subitems {element_ids face_ids}

      • GiD_EntitiesGroups unassign <group> ?-also_lower_entities? ?-element_type <types_allowed>? <over> ?<selection>?

To unassign the selection of entities of kind over of the group.
If -element_type <types_allowed> is specified then only the types of elements listed in <types_allowed> will be taken into account. <types_allowed> must be a list of triangle quadrilateral, etc.
If <selection> is missing, then all entities of kind <over> are unassigned of <group>

      • GiD_EntitiesGroups unassign all_geometry|all_mesh|all

all_geometry:To unassign all groups of all geometric entities
all_mesh: To unassign all groups of all mesh entities
all: To unassign all groups of all entities

      • GiD_EntitiesGroups get <group> <over> ?-count? ?-element_type <types_allowed>? ?-visible?

To get the list of entities of kind <over> that belong to <group>.
If <over> is faces then is obtained a list with 2 sublists: element id's and face id's
If <over> is all_geometry then is obtained a list with 4 sublists: point id's, line id's, surface id's and volume id's
If <over> is all_mesh then is obtained a list with 3 sublists: node id's, element id's, face id's (and face id's is a list with 2 items: element id's and face id's)
if -count is speficified, then only the number of objects is returned instead of its list.
if -element_type <types_allowed> is specified then only the types of elements listed in <types_allowed> will be taken into account. <types_allowed> must be a list of triangle quadrilateral, etc.
if -visible is specified, then only the entities visible must be taken into account
In fact it is returned an 'objarray': a Tcl_Obj object specialized for arrays, implemented as a Tcl package named 'objarray'. (for more information see scripts\objarray\objarray.pdf)

    • GiD_EntitiesGroups entity_groups <over> <id>

To get the list of groups to which the entity <id> of type <over> belongs
<over> could be points, lines, surfaces, volumes, nodes, elements, faces
<id> is the entity number, starting from 1. In case of faces it is a list with tho items: {<element_id> <face_id>}, with <face_id> starting from 1

  • No labels