GiD - The personal pre and post processor

Entities


GiD_EntitiesLayers assign|assign_back_layer|assign_front_layer|get|print|entity_layer
To handle the entities that belong to layers

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

To assign 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 items with the list of ids of nodes and elements respectively

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 items with the list of ids of nodes and elements respectively

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 which 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 specified, 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 print <layer> nodes|elements ?-element_type <types_allowed>? ?-offset_element_num <offset>? ?-factor <factor>? <format> <channel>

To print to the file given by <channel> the nodes or elements of the mesh that belong to <layer> with the specified <format>.

The returned value is the number of nodes or elements of this layer.

for each node it expects to print node_num x y z, then the <format> must be according to an integer for the num and 3 double numbers for the node coordinates

if -factor <factor> is provided then the x,y,z coordinates are multiplied by this scale <factor>, that must be a real number>0 (e.g. to change the scale or the units)

for each element it expects to print the element_id and then element_connectivities, then the <format> must be according to an integer for the num and element_nnode integers for its node ids. 

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 -offset_element_num <offset> is present, then instead the element_num will print an increasing counter, starting from <offset>. <offset> must be an integer >=-1 (usually 0 to print 1, 2, 3,... but can be -1 to print 0,1,2,...)


Example: to print  in a file named $filename the node id and x y z of the nodes belonging to $layer_name

set fp [open $filename w]
GiD_EntitiesLayers print $layer_name nodes "%i %g %g %g\n" $fp
close $fp


Example: to print the element connectivities of the elements of type triangle belonging to $layer_name (expected non quadratic case, with 3 nodes by triangle), and omit print the element id with %.0s

GiD_EntitiesLayers print $layer_name elements -element_type Triangle "%.0s%i %i %i\n" $fp
  • 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.


Example: to know the layer of the surface with num 12

set layer_name [GiD_EntitiesLayers entity_layer surfaces 12]

COPYRIGHT © 2022 · GID · CIMNE