GiD-Tcl special commands to manage books, materials, conditions, intervals, general data or local axes:
Special Tcl commands>Data (problemtype classic)>Books
GiD_Book material|condition create|set|exists
To create or know if a book of materials or conditions exists, or to set its current book.
Books are like a container to visually separe materials or conditions in submenus and different windows
- GiD_Book material|condition create <book>
To create a new book named <book> in the collection of books of materials or conditions
- GiD_Book material|condition set <book> <name>
To set as <book> as current book of a material or condition named <name>
- GiD_Book material|condition exists <book>
To check if the book <book> exists in the collection of books of materials or conditions
Special Tcl commands>Data (problemtype classic)>CreateData
GiD-Tcl special commands to create and delete materials and conditions:
GiD_CreateData create|delete material|material_base|condition ...
To create or delete materials or conditions:
GiD_CreateData create material <basename> <name> <values>
To create a material with the same question fields as a base material but different values:
- <basename> this only applies to the create material operation, and is the base material from which the new material is derived;
- <name> is the name of material itself;
- <values> is a list of all field values for the new material.
...
- <name> is the name of material;
- <questions> and <values> are lists of all questions and values for the new material. If values are missing empty values are used.
...
- <over_geometry> must be ovpnt|ovline|ovsurf|ovvol|ovlayer|ovgroup
- <over_mesh> must be ovnode|ovbodyelem|ovfaceelem
...
- <name> is the name of the material or condition;
- <over> must be: points, lines, surfaces, volumes, layers, groups, nodes, elements, body_elements, or face_elements (elements is equivalent to body_elements). Layers and groups is valid for conditions defined over them, but not for materials.
- <values> is only required for conditions. If it is set to "" then the default values are used;
- <entities> a list of entities (it is valid to use ranges as a:b ,can use "all" to select everything, "end" to specify the last entity, layer:<layername> to select the entities in this layer) ; if <over> is face_elements then you must specify a list of "entity numface" instead just "entity". (numface starting from 1)
...
- <name> is the name of the material or condition; Can use "*" to match all materials
- <over> must be: points, lines, surfaces, volumes, layers, nodes, elements, body_elements, or face_elements (elements is equivalent to body_elements);
It is possible to use all_geometry|all_mesh||all to unassign of all entities of geometry or mesh or both. Then <entities selection> must not be provided.
- <entities> a list of entities (it is valid to use ranges as a:b ,can use "all" to select everything, "end" to specify the last entity, layer:<layername> to select the entities in this layer) ; if <over> is face_elements then you must specify a list of "entitynumface" instead just "entity".
- wherefield <fieldname> <fieldvalue> To unassign this condition olny for the entities where the field named 'fieldname' has the value 'fieldvalue'
...
- <condition> is the name of the condition;
- <over> must be: points, lines, surfaces, volumes, layers, groups, nodes, elements, body_elements, or face_elements (elements is equivalent to body_elements).
- <question> is the field name to be changed
- <field_index> is the field number, starting from 0 (if -field_index was used)
- <value> is the new value to be set
- <entities> a list of entities (it is valid to use ranges as a:b ,can use "all" to select everything, "end" to specify the last entity, layer:<layername> to select the entities in this layer) ; if <over> is face_elements then you must specify a list of "entity numface" instead just "entity". (numface starting from 1)
...
- <name> is the material name or interval number;
- <values> is a list of all the new field values for the material, interval data or general data.
if -book is specified then this value is the new book name, and could be applied only to material or condition
Example:
GiD_ModifyData material Steel {2.1e6 0.3 7800}
GiD_ModifyData intvdata 1 ...
GiD_ModifyData gendata ...
GiD_ModifyData -book material Steel my_new_book
GiD_ModifyData localaxes <condition_name> ?geometry|mesh? <entity_ids...> <entiy_euler_angles...>
To change the 3 euler angles of the local axis of a condition <condition_name> attached to entities of geometry or mesh.
- <condition_name> is the name of the condition (local axis are associated to a condition with an special #LA# field)
- <entity_ids...> is a list (objarray) of integers with the ids of the entities (of the type as the condition was defined over geometry or mesh)
- <entiy_euler_angles...> is a list (objarray) of reals with the consecutive 3 values to set to each entity of the list.
The amount of angles must 3*amount of ids
Special Tcl commands>Data (problemtype classic)>AccessValue
GiD_AccessValue ?-index? set|get ?-default? material|condition|intvdata|gendata ?<name>? <question> ?<attribute>? <value>
To get or set some field values of materials, interval data or general data:
if -index is specified then the material or condition number (starting from 1) will be expected instead of its name
if -default is specified then the get option returns the default value instead of the current value
(the default value is value set in the problemtype file)
- <name> is the material, condition name or interval number (not necessary for gendata);
- <question> is a field name;
- <attribute> is the attribute name to be changed (STATE, HELP, etc.) instead of the field value;
- <value> is the new field or attribute value.
...
- <mode> must be 'create', 'delete' or 'set';
- <number> is the interval number (integer >=1).
Create returns the number of the newly created interval and can optionally use 'copyconditions' to copy to the new interval the conditions of the current one.
For create mode, if <number> is supplied the new interval is inserted in this location, else is append to end.
For set mode, if <number> is not supplied, the current interval number is returned.
Example:
set current [GiD_IntervalData set]
GiD_IntervalData set 2
set newnum [GiD_IntervalData create]
set newnum [GiD_IntervalData create copyconditions]
set newnum [GiD_IntervalData create $i_insert copyconditions]
Special Tcl commands>Data (problemtype classic)>LocalAxes
GiD_LocalAxes <mode> <name> ?<type>? <Cx Cy Cz> <PAxex PAxey PAxez> <PPlanex PPlaney PPlanez>?
To create, delete or modify local axes:
- <mode>: must be one of "create|delete|edit|exists", which correspond to the operations: create, delete, edit or exists;
- <name>: is the name of local axes to be created or deleted;
- <type>: must be one of "rectangular|cylindrical|spherical C_XZ_Z|C_XY_X". Currently, GiD only supports rectangular axes. C_XZ_Z is an optional word to specify one point over the XZ plane and another over the Z axis (default). C_XY_X is an optional word to specify one point over the XY plane and another over the X axis;
- <Cx Cy Cz> is a Tcl list with the real coordinates of the local axes origin;
- <PAxex PAxey PAxez> is a Tcl list with the coordinates of a point located over the Z' local axis (where Z' is positive). The coordinates must be separated by a space. If the z coordinate is missing, it is set to z=0.0;
- <PPlanex PPlaney PPlanez> is a Tcl list with the coordinates of a point located over the Z'X'half-plane (where X' is positive).
...
- GiD_Units get magnitude_units <magnitude>
Returns the list of allowed units for the <magnitude> (of the current unit system)
<magnitude> must be one of the values returned by [GiD_Units get magnitudes]
- GiD_Units get magnitudes
Returns the list of defined magnitudes
- GiD_Units get system
To return the current units system string
e.g.
GiD_Units get system
-> SI
- GiD_Units edit system <value>
...
- GiD_Units get model_unit_length
To return the current geometry length unit string.
This unit declare the length unit of the coordinates of the geometry or mesh
e.g.
GiD_Units get model_unit_length
-> m
- GiD_Units edit model_unit_length <value>
To set the current geometry length unit.
<value> must be one of the values returned by [GiD_Units get magnitude_units <length_magnitude>]
Where <length_magnitude> must be the length magnitude name. This name depends on the problemtype units definition (L, LENGTH, or others)
e.g.
GiD_Units edit model_unit_length mm