GiD - The personal pre and post processor

GiD_Info layers

GiD_Info layers
This command returns a list of the layers in the project. These options are also available:

    • <layer_name>: If a layer name is given, the command returns the properties of that layer.
    • -on: Returns a list of the visible layers.
    • -off: Returns a list of the hidden layers.
    • -hasbacklayers: Returns 1 if the project has entities inside back layers.
    • Note: GiD_Info back_layers returns a list with the back layers

Example:
in: GiD_Info back_layers
out: Layer2_back

    • -bounding_box ?-use geometry|mesh? <layer_name_1> <layer_name_2> ...

Returns six real numbers representing two corner coordinates "min_x min_y min_z max_x max_y max_z" which define the bounding box of the entities that belong to the list of layers.
If the option -use geometry|mesh is used, the command returns the bounding box of the geometry or the bounding box of the mesh. (otherwise it consider the current view mode in use)
If the list of layers is empty the result of all layers (not zero layers) is returned

In case of zero entities the bounding box return the values "0.0 0.0 0.0 0.0 0.0 0.0"

Note: Until GiD 17.1.3d the flag was -bbox and return a different syntax "{max_x max_y max_z min_x min_y min_z}", with a sublist and max - min swapped.  Can be used for back compatibility with old scripts.


    • ?-count? -entities <type> ?-elementtype <elementtype>? ?-higherentity <num>?: One of the following arguments must be given for <type>: nodes, elements, points, lines, surfaces or volumes. A layer name must also be given. The command will return the nodes, elements, points, lines surfaces or volumes of that layer. If -count is set then the amount of entities is returned instead of the list of its ids.


For elements it is possible to specify -elementtype <elementtype>to get only this kind of elements.
-higherentity <num>Allow to get only entities with this amount of higherentities.

    • -canbedeleted <layer_name> returns a list with two items: a boolean 0|1 to know if layer or its child layers have some entity or parts in back layer or conditions over the layer. the second item is a message explaining the cause to not delete it directly.


Examples:
in: GiD_Info layers
out: "layer1 layer2 layer_aux"
in: GiD_Info layers -on
out: "layer1 layer2"
in: GiD_Info layers -entities lines layer2
out: "6 7 8 9"
in: GiD_Info layers -count -entities lines layer2
out: 4

COPYRIGHT © 2022 · GID · CIMNE