Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Special Tcl commands>Layers>Definition
GiD_Layers create|delete|edit|get|list|window|exists|is_forbidden_name

    • GiD_Layers create <layer>

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

    • GiD_Layers delete <layer>

To delete a layer

    • GiD_Layers edit name|color|opaque|visible|frozen|parent|state|to_use <layer> <value>

To modify layer properties:

        1. name: change its name
        2. color: set the color to draw its entities (with format #rrggbbaa)
        3. opaque: opaque or transparent (0 or 1)
        4. visible: set visibility of its entities (0 or 1)
        5. frozen: set frozen to disable select its entities (0 or 1)
        6. parent: to change the parent of a layer
        7. state: to change the layer state (normal, disabled or hidden). hidden layers are not listed or visible in windows.
        8. to_use: in this case <value> must not be providen, and <layer> is the one to be set as current 'layer to use' (where new entities will be created)
    • GiD_Layers get color|opaque|visible|frozen|parent|state|num_entities|num_conditions|id|back|to_use|all_properties <layer>

To obtain the current value of some property:

        1. num_entities: the total number of geometric or mesh entities that belong to the layer
        2. num_conditions: the total number of conditions applied to the layer
        3. id: the numeric identifier of the layer
        4. back: return 1 if the layer has entities in its 'back' layer (entities in back are not drawn until they are sent again to front)
        5. to_use: in this case <layer> must not be providen, it is returned the current 'layer to use' (where new entities will be created)
        6. all_properties: return a list of property value with the properties of the layer
    • GiD_Layers list ?<parent>? ?descendants?

To get the list of fullnames of the current layers.
If a parent is specified, then only relative names of child layers will be listed. Root parent could be specified with an empty string ""
If desdendants is specified return a list of all descendants (childs, childs of childs, ...)

    • GiD_Layers window open|close|update

Show or hide the layers window or update its content

    • GiD_Layers exists <layer>

Return 1 if layer exists, 0 else

    • GiD_Layers is_forbidden_name <layer>

Return 1 if layer name has forbidden syntax
Special Tcl commands>Layers>Entities
GiD_EntitiesLayers assign|get|entity_layer
To handle the entities that belong to layers

    • GiD_EntitiesLayers assign|assign_back_layer|assign_front_layer|get <layer> ?-also_lower_entities? <over> <selection>

To add or know entities of a layer

      • GiD_EntitiesLayers assign <layer> ?-also_lower_entities? ?-also_higher_entities? <over> <selection>

To assing the selection of entities of kind over to the layer
<layer> is the full name of the layer
<-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)
<-also_higher_entities> is an optional flag, to select also all higher entities of the selected ones (e.g. volumes of the selected surfaces)
<over> could be points, lines, surfaces, volumes, nodes, elements, all_geometry, all_mesh
<selection> is a list of integer entity id's starting from 1.
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 2 itemos with the list of ids of nodes and elements respectivelly

      • GiD_EntitiesLayers assign_back_layer ?-also_lower_entities? ?-also_higher_entities? <over> <selection>

To send the selection of entities of kind over to the back (hidden part) of its layer
<-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)
<-also_higher_entities> is an optional flag, to select also all higher entities of the selected ones (e.g. volumes of the selected surfaces)
<over> could be points, lines, surfaces, volumes, nodes, elements, all_geometry, all_mesh
<selection> is a list of integer entity id's starting from 1.
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 2 itemos with the list of ids of nodes and elements respectivelly

      • GiD_EntitiesLayers assign_front_layer ?-also_lower_entities? ?-also_higher_entities? geometry|mesh all_entities|layer_entities|<over> <layer>|<selection>

To send the entities of <layer> again to the front (visible part) of its layer
<-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)
<-also_higher_entities> is an optional flag, to select also all higher entities of the selected ones (e.g. volumes of the selected surfaces)
geometry|mesh specify wich layer entities must be sent to front: geometry or mesh entities
all_entities: will send all entities of the geometry or mesh. In this case <layer> must not be specified
layer_entities <layer>: will send to front only the geometry or mesh entities of this layer.
<over> <selection>: will send the selection of entities of type <over> (points, lines, surfaces, volumes, nodes or elements)

      • GiD_EntitiesLayers get <layer> <over> ?-count? ?-element_type <types_allowed>?

To get the list of entities of kind <over> that belong to <layer>.
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 2 sublists: node id's and element 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.
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_EntitiesLayers entity_layer <over> <id>

To get the layer to which the entity <id> of type <over> belongs
<over> could be points, lines, surfaces, volumes, nodes, elements
<id> is the entity number, starting from 1.