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.
GiD_CreateData delete material|material_base <name>
To delete a material
GiD_CreateData create material_base <name> {{question_1 ... question_n} ?{value_1 value_n}?}
To create a base material: (define the fields of a new material to be used to derive new materials from it)
- <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.
GiD_CreateData create condition <name> <over_geometry> <over_mesh> {{question_1 ... question_n} ?{value_1 value_n}?}
To create a condition:
- <over_geometry> must be ovpnt|ovline|ovsurf|ovvol|ovlayer|ovgroup
- <over_mesh> must be ovnode|ovbodyelem|ovfaceelem
GiD_CreateData delete condition <name>
To delete a condition:
Example:
set id_material [GiD_CreateData create material Steel Aluminium {3.5 4 0.2}]
GiD_CreateData delete material Aluminium
set id_condition [GiD_CreateData create condition surface_pressure ovsurf ovfaceelem pressure} {0.0
]
GiD_CreateData delete condition surface_pressure
Special Tcl commands>Data (problemtype classic)>AssignData
GiD_AssignData material|condition <name> <over> ?<values>? <entities>
To assign materials or conditions over entities:
- <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)
Example:
GiD_AssignData material Steel Surfaces {2:end}
GiD_AssignData condition Point-Load Nodes {3.5 2.1 8.0} all
GiD_AssignData condition Face-Load face_elements {3.5 2.1 8.0} {15 1 18 1 20 2}
Special Tcl commands>Data (problemtype classic)>UnAssignData
GiD_UnAssignData material|condition <name> <over> <entities> ?wherefield <fieldname> <fieldvalue>?
To unassign materials or conditions of some entities:
- <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'
Example:
GiD_UnAssignData material * surfaces {end-5:end}
GiD_UnAssignData condition Point-Load nodes layer:Layer0
GiD_UnAssignData condition Face-Load face_elements {15 1 18 1 20 2}
Special Tcl commands>Data (problemtype classic)>AccessValueAssignedCondition
GiD_AccessValueAssignedCondition ?-field_index? set|get <condition> <over> {<question>|<field_index> ?<value>? ... <question>|<field_index> ?<value>?} <entities>
To get or set field values of conditions applied over entities:
- <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)
Example:
GiD_AccessValueAssignedCondition -field_index set Point_BC points {0 5sec} {2}
Special Tcl commands>Data (problemtype classic)>ModifyData
GiD_ModifyData ?-book? material|condition|intvdata|gendata|localaxes ?<name>? <values>
To change all field values of materials, interval data or general data:
- <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.
Example:
GiD_AccessValue set gendata Solver Direct
set mass [GiD_AccessValue -index get material $material_id mass]
set default_value [GiD_AccessValue get -default gendata $question]
Special Tcl commands>Data (problemtype classic)>IntervalData
GiD_IntervalData <mode> ?<number>? ?copyconditions?
To create, delete or set interval data;
- <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).
For the 'exists' operation, if only the <name> field is specified, 1 is returned if this name exists, and 0 if it does not. If the other values are also apecified, <name> is ignored.
The value returned is:
-1 if the global axes match;
-2 if the automatic local axes match;
-3 if the automatic alternative local axes match;
0 if it does not match with any axes;
<n> if the user-defined number <n> (n>0) local axes match.
Example:
GiD_LocalAxes create "axes_1" rectangular C_XY_X {0 0 0} {0 1 0} {1 0 0}
GiD_LocalAxes delete axes_1
GiD_LocalAxes exists axes_1
GiD_LocalAxes exists "" rectangular C_XY_X {0 0 0} {0 1 0} {1 0 0}
this last sample returns -1 (equivalent to global axis)
Special Tcl commands>Data (problemtype classic)>Units
GiD_Units edit|get magnitude_units|magnitudes|model_unit_length|system ?<value>?
To allow get or modify units and magnitudes.
Note: units doesn't exists without load a problemtype that define them
- 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>
To set the current units system
e.g.
GiD_Units edit system imperial
- 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