GiD customization manual : 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

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

Returns an item with a list of six real numbers representiong two coordinates (x1,y1,z1,x2,y2,z2) 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 .
If the list of layers is empty, the maximum bounding box is returned.

    • ?-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 amound 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