|
GiD offers the following Tcl functions:
|
GiD_Process command_1 command_2 ...
This is a simple function, but a very powerful one. It is used to enter commands directly inside the central event manager. The commands have the same form as those typed in the command line within GiD.
You have to enter exactly the same sequence as you would do interactively, including the escape sequences (using the word escape) and selecting the menus and operations used.
You can obtain the exact commands that GiD needs by checking the Right buttons menu (Utilities -> Tools -> Toolbars). It is also possible to save a batch file (Utilities -> Preferences) where the commands used during the GiD session can be checked.
Here is a simple example to create one line:
GiD_Process Mescape Geometry Create Line 0,0,0 10,0,0 escape
Note
: Mescape
is a multiple 'escape'
command, to go to the top of the commands tree.
|
GiD_Info option
This function provides any information about GiD, the current data or the state of any task inside the application. Depending on the arguments introduced after the GiD_Info sentence, GiD will output different information:
This command returns a list of the materials in the project.
These options are also available:
- ["material_name"]: If a material name is given, its properties are returned. It is also possible to add the option [OTHERFIELDS] to get the fields of that material, or the option [BOOK] to get the book of that material.
- [BOOKS]: If this option is given, a list of the material books in the project is returned.
Examples:
in:
GiD_Info materials
out:
"Air Steel Aluminium Concrete Water Sand"
in:
GiD_Info materials Steel
out:
"1 Density 7850"
This command returns a list of the conditions in the project. One of the arguments ovpnt, ovline, ovsurf, ovvol must be given to indicate the type of condition required, respectively, conditions over points, lines, surfaces or volumes.
Instead of ovpnt, ovline, ovsurf, ovvol , the following options are also available:
- [-interval "intv"] [-localaxes | -localaxesmat | -localaxescenter | -localaxesmatcenter ] "condition_name" [geometry | mesh] : if a condition name is given, the command returns the properties of that condition. It is also possible to add the options geometry or mesh, and all geometry or mesh entities that have this condition assigned will be returned. If -interval "intv" is set, then the conditions on this interval ("intv"=1,...n) are returned instead of those on the current interval. If -localaxes is set, then the three numbers that are the three Euler angles that define a local axes system are also returned (only for conditions with local axes, see Local axes ). Selecting -localaxesmat, the nine numbers that define the transformation matrix of a vector from the local axes system to the global one are returned. If -localaxescenter is set, then the three Euler angles and the local axis center are also returned. Selecting -localaxesmatcenter returns the nine matrix numbers and the center.Adding the number id of an entity ( ["entity_id"] ) after the options mesh or geometry, the command returns the value of the condition assigned to that entity.Other options available if the condition name is given are [OTHERFIELD], to get the fields of that condition, and [BOOK], to get the book of the condition.
- [BOOKS]: If this option is given, a list of the condition books of the project is returned.
Examples:
in:
GiD_Info conditions ovpnt
out:
"Point-Weight Point-Load"
in:
GiD_Info conditions Point-Weight
out:
"ovpnt 1 Weight 0"
in:
GiD_Info conditions Point-Weight geometry
out:
"E 1 - 2334 , E 2 - 2334 , E 3 - 343"
in:
GiD_Info Conditions -localaxes Concrete_rec_section mesh 2
out:
{E 2 - {4.7123889803846897 1.5707963267948966 0.0} N-m 0.3 0.3 HA-25}
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. GiD_Infoback_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 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.
- [-entities]: One of the following arguments must be given: nodes,elements,points,lines,surfaces orvolumes. A layer name must also be given. The command will return the nodes, elements, points, lines surfaces or volumes of that layer.
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"
This command returns the information entered in the Problem Data window (see Problem and intervals data file (.prb) ).
The following options are available:
- [OTHERFIELDS]: It is possible to add this option to get the additional fields from the Problem Data window.
- [BOOKS]: If this option is given, a list of the Problem Data books in the project is returned.Example: in: GiD_Info gendata out: "2 Unit_System#CB#(SI,CGS,User) SI Title M_title"
This command returns a list of the interval data in the project (see Problem and intervals data file (.prb) ). The following options are available:
This command returns information about the project. More precisely, it returns a list with:
- Problem type name.
- Current model name.
- 'There are changes' flag.
- Current layer to use.
- Active part (GEOMETRYUSE, MESHUSE, POSTUSE or GRAFUSE).
- Quadratic problem flag.
- Drawing type (normal, polygons, render, postprocess).
- NOPOST or YESPOST.
- Debug or nodebug.
- GiD temporary directory.
- Must regenerate the mesh flag (0 or 1).
- Last element size used for meshing (NONE if there is no mesh).
- BackgroundFilename is the name of a background mesh file to assign mesh sizes.
- RequireMeshSize. (1 if all sizes are specified by the number of divisions, then user is not required to specify the mesh size)
- RecommendedMeshSize. (The value of the mesh size that the program will recommend, based on the model size)
It is possible to ask for a single item only rather than the whole list, with <item> equal to: ProblemType|ModelName|AreChanges|LayerToUse|ViewMode|Quadratic|RenderMode|ExistPost|Debug|TmpDirectory|MustReMesh|LastElementSize|BackgroundFilename|RequireMeshSize|RecommendedMeshSize
Example:
in:
GiD_Info Project
out:
"cmas2d e:\models\car_model 1 layer3 MESHUSE 0 normal YESPOST nodebug C:\TEMP\gid2 0 1.4"
in:
GiD_Info Project ModelName
out:
"e:\models\car_model"
This command gives the user information about the geometry in the project. For each entity, there are two possibilities:
- [NumPoints]: Returns the total number of points in the model.
- [NumLines]: Returns the total number of lines.
- [NumSurfaces]: Returns the total number of surfaces.
- [NumVolumes]: Returns the total number of volumes.
- [NumDimensions]: Returns the total number of dimensions.
- [MaxNumPoints]: Returns the maximum point number used (can be higher than NumPoints).
- [MaxNumLines]: Returns the maximum line number used.
- [MaxNumSurfaces]: Returns the maximum surface number used.
- [MaxNumVolumes]: Returns the maximum volume number used.
- [MaxNumDimensions]: Returns the maximum dimension number used.
This command gives the user information about the selected mesh in the project.
It returns a 1 followed by a list with all types of element used in the mesh.
- [NumElements [Elemtype] [nnode]] : returns the number of elements of the mesh. Elemtype can be: Linear/Triangle/Quadrilateral/Tetrahedra/Hexahedra/Prism/Pyramid/Point/Sphere/Circle/Any. nnode is the number of nodes of an element.
- [NumNodes]: Returns the total number of nodes of the mesh.
- [MaxNumElements]: Returns the maximum element number.
- [MaxNumNodes]: Returns the maximum node number.
- [-pre | -post -step <step>]: To specify to use the preproces or postprocess mesh, and the time step if it changes along the time.
- [Elements Elemtype[First_idLast_id]]: R eturns a list with the element number, the connectivities , radius if it is a sphere, normal if it is a circle, and the material number, from 'first_id' to 'last_id, if they are specified.
- [Nodes[First_idLast_id]]: Returns a list with the node number and x y z coordinates, from 'first_id' to 'last_id', if they are specified.
- [-sublist] : Returns each result item as a Tcl list (enclosed in braces)
- [-array] : Returs the resuls as a list of vectors (more efficient)
Examples:
in:
GiD_Info Mesh
out:
"1 Tetrahedra Triangle"
in:
GiD_Info Mesh MaxNumNodes
out:
"1623"
This command returns the coordinates (x,y,z) of a given point or node.
This command returns the value of the variable indicated. GiD variables can be found in the Right buttons menu (see Tools ), under the option Utilities -> Variables.
Returns a list with all the user defined local axes.
info localaxes <name> returns the parameters (three euler angles and the center) that define the local axes called <name>.
info localaxes <name> -localaxesmat instead of returning the three euler angles, it returns the nine numbers that define the transformation matrix of a vector from the local axes system to the global one.
This command returns a list (Left, Right, Bottom, Top, Near, Far, Ext) of the limits of the geometry in the project.
In perspective mode near and far have the perspective distance substracted.
This command returns which perspective factor is currently being used in the project.
This command returns the coordinates (x,y,z) of the center of rotation.
This command returns a list of numbers. These naturals are the Y relative values of the graph shown in the option Meshing -> Mesh quality (see Mesh quality ) and two additional real numbers with the minimum and maximum limits.
This command has the following arguments:
- MinAngle/MaxAngle/ElemSize/ElemMinEdge/ElemMaxEdge/ElemShapeQuality/ElemMinJacobian/Radius: quality criterion.
- Linear/Triangle/Tetrahedra/QuadrilateralHexahedra/Prism/Pyramid/Point/Sphere/Circle: type of element.
- "min_value": e.g. minimum number of degrees accepted.
- "max_value": e.g. maximum number of degrees accepted.
if min_value and max_value are set to 0 then limits will be automatically set to the minimum and maximum of the mesh
- "num_divisions": number of divisions.
Example:
in: GiD_Info MeshQuality MinAngle Triangle 20 60 4
out: "13 34 23 0 20.0 60.0"
This command returns YES if the user is in the GiD postprocess, and NO, if not.
This command returns information about the GiD postprocess. The following options are available:
- all_volumes : Returns a list of all volumes.
- all_surfaces : Returns a list of all surfaces.
- all_cuts : Returns a list of all cuts.
- all_graphs : Returns a list of all graphs.
- all_volumes_colors : Returns a list of the volume colors used in the project. Colors are represented in RGB hexadecimal format. Example: #000000 would be black, and #FFFFFF would be white.
- all_surfaces_colors : Returns a list of the surface colors used in the project. Colors are represented in RGB hexadecimal format. Example: #000000 would be black, and #FFFFFF would be white.
- all_cuts_colors : Returns a list of the cut colors used in the project. Colors are represented in RGB hexadecimal format. Example: #000000 would be black, and #FFFFFF would be white.
- cur_volumes : Returns a list of the visible volumes.
- cur_surfaces : Returns a list of the visible surfaces.
- cur_cuts : Returns a list of the visible cuts.
- all_display_styles : Returns a list of all types of display styles available.
- cur_display_style : Returns the current display style.
- all_display_renders : Returns a list of all types of rendering available.
- cur_display_render : Returns the current rendering method.
- all_display_culling : Returns a list of all types of culling available.
- cur_display_culling : Returns the current culling visualization.
- cur_display_transparence : Returns Opaque or Transparent depending on the current transparency. Transparency is chosen by the user in the Select & Display Style window.
- cur_display_body_type : Returns Massive if the option Massive is selected in the Select & Display Style window. It returns Hollow if that option is not activated.
- all_analysis : Returns a list of all analyses in the project.
- all_steps "analysis_name" : Returns the number of steps of "analysis_name".
- cur_analysis : Returns the name of the current analysis.
- cur_step : Returns the current step.
- all_results_views : Returns all available result views.
- cur_results_view : Returns the current result view.
- cur_results_list : This option has one more argument: the kind of result visualization must be given. The available kinds of result visualization are given by the option all_results_views . The command returns a list of all the results that can be represented with that visualization in the current step of the current analysis.
- results_list : This option has three arguments: the first argument is the kind of result visualization. The available kinds of result visualization are given by the option all_results_views . The second argument is the analysis name. The third argument is the step number. The command returns a list of all the results that can be represented with that visualization in the given step.
- cur_result : Returns the current selected result. The kind of result is selected by the user in the View results window.
- cur_components_list "result_name" : Returns a list of all the components of the result "result_name".
- cur_component : Returns the current component of the current result.
- main_geom_state : Returns whether the main geometry is Deformed or Original
- main_geom_all_deform : Returns a list of all the deformation variables (vectors) of the main geometry.
- main_geom_cur_deform : Returns the current deformation variable (vectors) of the main geometry.
- main_geom_cur_step : Returns the main geometry current step.
- main_geom_cur_anal : Returns the main geometry current analysis.
- main_geom_cur_factor : Returns the main geometry current deformation factor.
- show_geom_state : Returns whether the reference geometry is Deformed or Original.
- show_geom_cur_deform : Returns the current deformation variable (vectors) of the reference geometry.
- show_geom_cur_analysis : Returns the reference geometry current analysis.
- show_geom_cur_step : Returns the reference geometry current step.
- iso_all_display_styles : Returns a list of all available display styles for isosurfaces.
- iso_cur_display_style : Returns the current display style for isosurfaces.
- iso_all_display_renders : Returns a list of all types of rendering available for isosurfaces.
- iso_cur_display_render : Returns the current rendering method for isosurfaces.
- iso_cur_display_transparence : Returns Opaque or Transparent depending on the current transparency of isosurfaces.
- contour_limits : Returns the minimum and maximum value of the contour limits. Before each value, the word STD appears if the contour limit value is the default value, and USER if it is defined by the user.
- animationformat : Returns the default animation format.
- cur_show_conditions : Returns the option selected in the Conditions combo box of the Select & Display Style window. (Possible values: Geometry Mesh None)
- all_show_conditions : Returns all the options available in the Conditions combo box of the Select & Display Style window. (Geometry Mesh None)
- cur_contour_limits : Returns the minimum and maximum value of the current value.
- current_color_scale : Returns a list of the colors used for the color scale; the first element of the list is the number of colors. Each color is represented in RGB hexadecimal format. Example: #000000 would be black, and #FFFFFF would be white.
This command returns the value of the Import Tolerance used in the project. This value is defined in the Preferences window under Import .
This command returns the default background color in RGB. The format is three 8 bit numbers separated by #. Example: 255#255#255 would be white.
This command returns a list with general information about the current GiD project.
PreStatus ask for the information of preprocess
PostStatus ask for the information of postprocess
Status return the infomation of pre or postprocess depending of where are now, in pre or post mode.
Example:
in:
GiD_Info list_entities PreStatus
out:
Project name: UNNAMED
Problem type: UNKNOWN
Changes to save(0/1): 1
Necessary to mesh again (0/1): 1
Using LAYER: NONE
Interval 1 of 1 intervals
Degree of elements is: Normal
Using now mode(geometry/mesh): geometry
number of points: 6
number of points with 2 higher entities: 6
number of points with 0 conditions: 6
number of lines: 6
number of lines with 1 higher entities: 6
number of lines with 0 conditions: 6
number of surfaces: 1
number of surfaces with 0 higher entities: 1
number of surfaces with 0 conditions: 1
number of volumes: 0
number of nodes: 8
number of nodes with 0 conditions: 8
number of Triangle elements: 6
number of elements with 0 conditions: 6
Total number of elements: 6
Last size used for meshing: 10
Internal information:
Total MeshingData:0 Active: 0 0%
This command returns information about entities.
It has the following arguments:
- Points/Lines/Surfaces/Volumes/Dimensions/Nodes/Elements/Results : Type of entity or Results. Note: If the user is postprocessing in GiD, the information returned by Nodes/Elements concerns the nodes and elements in postprocess, including its results information. To access preprocess information about the preprocess mesh, the following entity keywords should be used: PreNodes/PreElements .
- entity_id : The number of an entity. It is also possible to enter a list of entities (e.g.: 2 3 6 45), a range of entities (e.g.: entities from 3 to 45, would be 3:45) or a layer (e.g.: layer:layer_name).
Using "list_entities Results" you must also specify <analysis_name> <step> <result_name> <indexes>With the option -more, more information is returned about the entity. The -more option used with lines returns the length of the line, its radius (arcs), and the list of surfaces which are higher entities of that line; used with elements it returns the type of element, its number of nodes and its volume.
Example 1:
in:
GiD_Info list_entities Points 2 1
out:
POINT
Num: 2 HigherEntity: 1 conditions: 0 material: 0
LAYER: car_lines
Coord: -11.767595 -2.403779 0.000000
END POINT
POINT
Num: 1 HigherEntity: 1 conditions: 0 material: 0
LAYER: car_lines
Coord: -13.514935 2.563781 0.000000
END POINT
Example 2:
in:
GiD_Info list_entities lines layer:car_lines
out:
STLINE
Num: 1 HigherEntity: 0 conditions: 0 material: 0
LAYER: car_lines
Points: 1 2
END STLINE
STLINE
Num: 13 HigherEntity: 0 conditions: 0 material: 0
LAYER: car_lines
Points: 13 14
END STLINE
Example 3 (using -more ):
in:
GiD_Info list_entities -more Lines 2
out:
STLINE
Num: 2 HigherEntity: 2 conditions: 0 material: 0
LAYER: Layer0
Points: 2 3
END STLINE
LINE (more)
Length=3.1848 Radius=100000
Higher entities surfaces: 1 3
END LINE
This command returns geometric information (coordinates, derivates, etc.) about parametric lines or surfaces.
For lines it has the following syntax:
GiD_Info parametric line entity_id coord|deriv_t|deriv_tt|t_fromcoord|t_fromrelativelength t|x y z
And for surfaces:
GiD_Info parametric surface entity_id coord|deriv_u|deriv_v|deriv_uu|deriv_vv|deriv_uv|normal|uv_fromcoord|maincurvatures u v|x y z
The result for each argument is:
- line|surface : Type of entity.
- entity_id : The number of an entity.
- coord : 3D coordinate of the point with parameter t (line) or u,v (surface).
- deriv_t : First curve derivative at parameter t.
- deriv_tt : Second curve derivative at parameter t.
- t_fromcoord : t parameter for a 3D point.
- t_fromrelativelength : parameter corresponding to a relative (from 0 to 1) arc length t
- deriv_u,deriv_v : First partial u or v surface derivatives.
- deriv_uu,deriv_vv,deriv_uv : Second surface partial derivatives.
- normal : Unitary surface normal at u,v parameters.
- uv_fromcoord : u,v space parameters for a 3D point.
- maincurvatures : return a list with 8 numbers: v1x v1y v1z v2x v2y v2z c1 c2
v1x v1y v1z : first main curvature vector direction (normalized)
v2x v2y v2z : second main curvature vector direction (normalized)
c1 c2: main curvature values
Note: The vector derivatives are not normalized.
Example:
in:
GiD_Info parametric line 26 deriv_t 0.25
out:
8.060864 -1.463980 0.000000
This command returns some specialized entities check.
For lines it has the following syntax:
GiD_Info check line <entity_id> isclosed
For surfaces:
GiD_Info check surface <entity_id> isclosed|isdegeneratedboundary|selfintersection
And for volumes:
GiD_Info check volume <entity_id> orientation|boundaryclose
The result for each argument is:
- line|surface|volume : Type of entity.
- <entity_id> : The number of an entity.
- isclosed : For lines: 1 if start point is equal to end point, 0 otherwise. For surfaces: A surface is closed if its coordinate curves (of the full underlying surface) with parameter 0 and 1 are equal. It returns a bit encoded combination of closed directions: 0 if it is not closed, 1 if it is closed in u, 2 if it is closed in v, 3 if it is closed in both u and v directions.
- isdegeneratedboundary : A surface is degenerated if some boundary in parameter space (south, east, north or west) becomes a point in 3d space. It returns a bit encoded combination of degenerated boundaries, for example: 0 if it is not degenerated, 9=2^0+2^3 if south and west boundaries are degenerated.
- selfintersection : Intersections check between surface boundary lines. It returns a list of detected intersections. Each item contains the two line numbers and their parameter values.
- orientation : For volumes, it returns a two-item list. The first item is the number of bad oriented volume surfaces, and the second item is a list of these surfaces' numbers.
- boundaryclose : For volumes, a boundary is topologically closed if each line is shared by two volume surfaces. It returns 0 if it is not closed and must be corrected, or 1 if it is closed.
Example:
in: GiD_Info check volume 5 orientation
out: 2 {4 38}
This command returns properties of the selected entities. It returns the length if entities are lines, area if surfaces, volume if volumes, or the center of gravity if entities are nodes or elements. It has the following arguments:
Example:
in:
GiD_Info ListMassProperties Lines 13 15
out:
LINES
n. Length
13 9.876855
15 9.913899
Selected 2 figures
________________________
Total Length=19.790754
This command returns the absolute path to the current problem type.
This command returns the GiD version number. For example 9.0
This command returns the current view parameters. Something like:
{x -13.41030216217041 13.41030216217041} {y 10.724431991577148 -10.724431991577148} {z -30.0 30.0} {e 10.0} {v 0.0 0.0 0.0} {r 1.0}
{m 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0} {c 0.0 0.0 0.0} {pd 0.0} {pno 0.0} {pfo 0.0} {pf 4.0} {pv 0.0} {NowUse 0}
{DrawingType 0} {LightVector 90.0 90.0 150.0 0.0}
See Save/Read View for a brief explanation of this parameters
GiD_Info IsPointInside ?-tolerance <tol>? Line|Surface|Volume <num> {<x> <y> <z>}
This commands returns 1 if the point {x y z} is inside the specified volume/surface/curve, or 0 if lies outside.
|
|
GiD_Geometry create|delete|get|list point|line|surface|volume <num>|append <data>
To create, delete, get data or list the identifiers of geometric entities:
- <num>|append : <num> is the entity identifier (integer > 0). You can use the word 'append' to set a new number automatically.
- <data> : is all the geometric definition data (create ) or a selection specification (delete , get or list ):
create: to make new geometric entities
- GiD_Geometry create volume <num>|append layer numsurfaces {surface1 verso1} ...
- GiD_Geometry create surface <num>|append plsurface|nurbssurface|coonsurface|meshsurface layer numlines ?<nurbs_data>? {line1 verso1} ... <geometrical_data>
<nurbs_data> must be provided only for NURBS surfaces and are this variables:
u_degree v_degree numpoints_u numpoints_v istrimmed isrational
<geometrical data> depends of each entity type (see get command)
- GiD_Geometry create line <num>|append nurbsline layer inipoint endpoint degree numpoints isrational {point1_x point1_y point1_z ?point1_w?} ... knot_1 ...
Instead the NURBS parameters is possible to create a curve that interpolates a list of points (also tangents at start and end can be specified)
GiD_Geometry create line <num>|append nurbsline layer inipoint endpoint -interpolate numpoints {p1_x p1_y p1_z} ... {pn_x pn_y pn_z} ?-tangents {t0_x t0_y t0_z} {t1_x t1_y t1_z}?
- GiD_Geometry create line <num>|append stline layer inipoint endpoint
- GiD_Geometry create point <num>|append layer point_x point_y point_z
delete: to erase model entities
- GiD_Geometry delete point|line|surface|volume <args> with <args>: num numa:numb numa: layer:layer_name
get: to obtain all the geometrical data to define a single entity
- GiD_Geometry get point|line|surface|volume <args> with <args>: num
- GiD_Geometry get point will return:
<layer> <geometrical data>
<layer> is the layer name
<geometrical data> the coordinates x y z
- GiD_Geometry get line will return:
<type> <layer> <p1> <p2> <geometrical data>
<type> can be: stline, nurbsline, arcline, polyline
<layer> is the layer name
<p1> identifier of start point
<p2> identifier of end point
<geometrical data> depends of each entity type
stline: nothing
nurbsline: <d> <n> <rat> {x y z ?w?}1 ... {x y z ?w?}n <k0> ... <kn+d>
<d>degree
<n>number of control points
<rat> 1 if rational, else 0
{xi yi zi ?wi?} control points coordinates. If rational wi is the weight
<ki> knots
arcline: {xc yc} <r> <sa> <ea> {m11 ... m44}
{xc yc} 2D center
<r> radius
<sa> start angle (rad)
<ea> end angle (rad)
{m11 ... m44} transformation 4x4 matrix (the identity for a 2D case)
m11 ...m33 is a rotation 3x3 matrix
m14 ...m34 is a translation 3x1 vector
m44 is an scale factor
m41 ... m43 must be 0
polyline: not implemented
- GiD_Geometry get surface will return:
<type> <layer> <nl> ?<nurbs_data>? {l1 o1} ... {lnl onl} <geometrical data>
<type> can be: nurbssurface plsurface coonsurface meshsurface
<layer> is the layer name
<nl> number of boundary lines (including holes)
<nurbs_data> only for NURBS surfaces (<du> <dv> <nu> <nv> <istrimmed> <isrational>)
{li oi} identifier of line and its orientation for the surface (1 if opposite to the line advance, 0 else)
Note: turning left of a line with orientation 0 we go inside the surface.
<geometrical data> depends of each entity type
plsurface: nothing
coonsurface: nothing
nurbssurface {x y z ?w?}1 ... {x y z ?w?}nu xnv <ku0 > ... <kunu+du > <kv0 > ... <kvnv+dv >
<du> <dv>degree in u, v direction
<nu> <nv>number of control points in each direction
<ratu> <ratv> 1 if rational, 0 else
{xi yi zi ?wi ?} control points coordinates. If rational wi is the weight
<kui > <kvi > knots in each direction
meshsurface: nn ne nnode {x1 y1 z1 ... xnn ynn znn } {a1 b1 c1 ?d1 ? ... ane bne cne ?dne ?}
nn: number of nodes
ne: number or elements (triangles or quadrilaterals)
nnode: number of nodes by element: 3 or 4
xi yi zi : coordinates
ai bi ci di : connectivities (di only for quadrilaterals)
- GiD_Geometry get volume will return:
<layer> <ns> {s1 o1} ... {snl onl}
<layer> is the layer name
<ns> number of boundary surfaces (including holes)
{si oi} identifier of surface and its orientation for the volume (1 if opposite to the surface normal, 0 else)
Note: the normal of a surface with orientation 0 points inside the volume
list: to get a list of entity identifiers of a range or inside some layer
- GiD_Geometry list point|line|surface|volume <args> with <args>: num numa:numb numa: layer:layer_name
Examples:
GiD_Geometry create surface 1 nurbssurface Layer0 4 1 1 2 2 0 0 {1 1} {4 1} {3 1} {2 1} \
{0.17799 6.860841 0.0} {-8.43042200 6.86084199 0.0} {0.17799400 0.938510 0.0} \
{-8.43042 0.938510 0.0} 0.0 0.0 1.0 1.0 0.0 0.0 1.0 1.0
GiD_Geometry list points 1: layer:layer_name
|
GiD_Mesh create|delete|edit|get node|element <num>|append <elemtype> <nnode> <N1 ... Nnnode> <radius> <nx ny nz> ?<matname>? | <x y z>
To create, delete, modify or know information about mesh nodes or elements of the preprocess:
- <num>|append : <num> is the identifier (integer > 0) for the node or element. You can use the word 'append' to set a new number automatically. The number of the created, deleted or modified entity is returned as the result. When deleting, it is possible to use a list of entities;
- <elemtype> : must be one of "point|linear|triangle|quadrilateral|tetrahedra|hexahedra|prism|pyramid|sphere|circle"
- <nnode> is the number of nodes an element has
- <N1 ... Nnnode> is a Tcl list with the element connectivities
- <radius> is the element radius, only for sphere and circle elements
- <nx ny nz> is the normal of the plane that contain the circle
- <matname> is the optional element material name
- <x y z> are the node coordinates. If the z coordinate is missing, it is set to z=0.0.
Examples:
GiD_Mesh create node append {1.5 3.4e2 6.0}
GiD_Mesh create element 58 triangle 3 {7 15 2} steel
GiD_Mesh delete element {58 60}
|
GiD-Tcl special commands to manage materials, conditions, intervals, general data or local axes:
GiD_CreateData create|delete material ?<basename>? <name> ?<values>?
To create or delete materials:
Example:
GiD_CreateData create material Steel Aluminium {3.5 4 0.2}
GiD_CreateData delete material Aluminium
GiD_AssignData material|condition <name> <over> ?<values>? <entities>
To assign materials or conditions over entities:
Example:
GiD_AssignData materials Steel Surface {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}
GiD_UnAssignData material|condition <name> <over> <entities> ?wherefield <fieldname> <fieldvalue>?
To unassign materials or conditions of some entities:
Example:
GiD_UnAssignData materials * Surface {end-5:end}
GiD_UnAssignData condition Point-Load Nodes layer:Layer0
GiD_UnAssignData condition Face-Load face_elements {15 1 18 1 20 2}
GiD_ModifyData materials|intvdata|gendata ?<name>? <values>
To change all field values of materials, interval data or general data:
Example:
GiD_ModifyData materials Steel {2.1e6 0.3 7800}
GiD_ModifyData intvdata 1 ...
GiD_ModifyData gendata ...
GiD_AccessValue set|get materials|conditions|intvdata|gendata ?<name>? <question> ?<attribute>? <value>
To change only some field values of materials, interval data or general data:
Example:
GiD_AccessValue set gendat Solver Direct
GiD_IntervalData <mode> <number>|?copyconditions?
To create, delete or set interval data;
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]
GiD_LocalAxes <mode> <name> ?<type>? <Cx Cy Cz> <PAxex PAxey PAxez> <PPlanex PPlaney PPlanez>?
To create, delete or modify local axes:
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)
|
GiD_Result create|delete|get|get_nodes ?-array? <data>
To create, delete or get postprocess results:
- GiD_Result create {Result header} { result_id scalar|vector|matrix_values} {...} {...} : these creation parameters are the same as for the postprocess results format (see Result of Postprocess results format: ProjectName.post.res ) where each line is passed as Tcl list argument of this command;
- GiD_Result delete {Result_name result_analysis step_value} : deletes one result;
- GiD_Result get [ -max | -min | -compmax | -compmin | -info -array] {Result_name result_analysis step_value} : retrieves the results value list of the specified result; or if one of the -max , -min , -compmax , -compmin , or -info flags was specified: the minimum/maximum value of the result, every minimum/maximum of the components of the result, or the header information of the result (with type and location) is retrieved, respectively;
- GiD_Result get_nodes: returns a list of nodes and their coordinates.
-array flag can be specified, for create and get subcommands, to use list of vectors to handle the information in a more efficient way
Examples:
GiD_Result create -array {Result "MyVecNodal" "Load analysis" 10 Vector OnNodes} {ComponentNames "Vx" "Vy" "Vz" "|velocity|"} {{1 3} {{2.0e-1 -3.5e-1} {2.0e-1 4.5e-1} {0.4 -2.1}}}
GiD_Result create {Result "Res Nodal 1" "Load analysis" 4 Scalar OnNodes} {1 2} {2 2} {113 2} {3 5} {112 4}
GiD_Result create {Result "Res Gauss 1" "Load analysis" 4 Scalar OnGaussPoints "My Gauss"} {165 2} {2} {3} {164 5} {4} {3}
GiD_Result get {"Res Nodal 1" "Load analysis" 4}
GiD_Result delete {"Res Nodal 1" "Load analysis" 4}
The names of the components of the result can also be retrieved and specified:
GiD_Result create {Result "Res Nodal 2" "Load analysis" 4 Vector OnNodes} {ComponentNames "x comp" "y comp" "z comp" "modulus"} {1 2 3 4 6} {2 2 8 3 -6}
|
GiD_OpenGL
It is possible to use OpenGL commands directly from GiD-Tcl by using the command "GiD_OpenGL draw". For example, for C/C++ use:
glBegin(GL_LINES);
glVertex(x1,y1,z1);
glVertex(x2,y2,z2);
glEnd();
for GiD-Tcl use:
GiD_OpenGL draw -begin lines
GiD_OpenGL draw -vertex [list $x1 $y1 $z1]
GiD_OpenGL draw -vertex [list $x2 $y2 $z2]
GiD_OpenGL draw -end
The standard syntax must be changed according to these rules: - OpenGL constants: "GL" prefix and underscore character '_' must be removed; the command must be written in lowercase.
Example:
GL_COLOR_MATERIAL
->colormaterial
- OpenGL functions: "GL" prefix must be removed and the command written in lowercase. Pass parameters as list, without using parentheses ()
Example:
glBegin(GL_LINES)
->glbegin lines
The subcommand "GiD_OpenGL draw" provides access to standard OpenGL commands, but other "GiD_OpenGL" special GiD subcommands also exist:
- register <tclfunc> Register a Tcl procedure to be invoked automatically when redrawing the scene. It returns a handle to unregister.
Example:
proc MyRedrawProcedure { } { ...body... }
set id [GiD_OpenGL register MyRedrawProcedure]
- unregister <handle> Unregister a procedure previously registered with register .
Example:
GiD_OpenGL unregister $id
- registercondition <tclfunc> <cond> Register a Tcl procedure to be invoked automatically when redrawing the specified condition. It returns a handle to unregister.
- unregistercondition <cond> Unregister a procedure previously registered with registercondition .
- draw <-cmd args -cmd args> This is the most important subcommand, it calls standard OpenGL commands. See the list of supported OpenGL functions.
- drawtext <text> Draw a text more easily than using standard OpenGL commands (draw in the current 2D location, see rasterpos OpenGL command).
Example:
GiD_OpenGL draw -rasterpos [list $x $y $z]
GiD_OpenGL drawtext "hello world"
- font push <font_name font_size> | pop | measure <text> | current | metrics ?-ascent|-descent|-linespace|-fixed?
push sets the current OpenGL font, pop restores the previous one
measure <text> returns the amount of space in pixels to display this <text>
current returns a list with the current font name and size
metrics returns a list with current font metrics information: -ascent -descent and -linespace in pixels, -fixed is 1 if all characters have equal size
Example:
GiD_OpenGL font push {"Times New Roman" 18}
set with [GiD_OpenGL measure "hello world"]
GiD_OpenGL drawtext "hello world"
GiD_OpenGL pop
- drawentity ?-mode normal|filled? point|line|surface|volume|node|element|dimension <id list> To draw an internal GiD preprocess entity.
Example:
GiD_OpenGL drawentity -mode filled surface "1 5 6"
- project <x y z> Given three world coordinates, this returns the corresponding three window coordinates.
- unproject <x y z> Given three window coordinates, this returns the corresponding three world coordinates.
- doscrzoffset <boolean> Special trick to avoid the lines on surfaces hidden by the surfaces.
List of supported OpenGL functions :
accum alphafunc begin blendfunc call calllist clear clearaccum clearcolor cleardepth clearstencil clipplane color colormask colormaterial copypixels cullface deletelists depthfunc depthmask dfactorBlendTable disable drawbuffer drawpixels edgeflag enable end endlist evalcoord1 evalcoord2 evalmesh1 evalmesh2 finish flush fog frontface frustum genlists hint hintModeTable initnames light lightmodel linestipple linewidth loadidentity loadmatrix loadname lookat map1 map2 mapgrid1 mapgrid2 material matrixmode modeColorMatTable multmatrix newlist newListTable normal opStencilTable opStencilTable ortho perspective pickmatrix pixeltransfer pixelzoom pointsize polygonmode popattrib popmatrix popname pushattrib pushmatrix pushname rasterpos readbuffer readpixels rect rendermode rotate scale scissor selectbuffer shademodel stencilfunc stencilmask stencilop texcoord texenv texgen teximage1d teximage2d texparameter translate vertex viewport
List of special non OpenGL standard functions :
getselection
List of supported OpenGL constants :
accum accumbuffer accumbufferbit add alphatest always allattrib allattribbits ambient ambientanddiffuse autonormal aux0 aux1 aux2 aux3 back backleft backright blend bluebias bluescale ccw clamp clipplane0 clipplane1 clipplane2 clipplane3 clipplane4 clipplane5 colorbuffer colorbufferbit colorindex colormaterial compile compileandexecute constantattenuation cullface current currentbit cw decal decr depthbuffer depthbufferbit depthtest diffuse dither dstalpha dstcolor enable enablebit emission equal eval evalbit exp exp2 eyelinear eyeplane feedback fill flat fog fogbit fogcolor fogdensity fogend fogmode fogstart front frontandback frontleft frontright gequal greater greenbias greenscale hint hintbit incr invert keep left lequal less light0 light1 light2 light3 light4 light5 light6 light7 lighting lightingbit lightmodelambient lightmodellocalviewer lightmodeltwoside line linebit linear linearattenuation lineloop lines linesmooth linestipple linestrip list listbit load map1color4 map1normal map1texturecoord1 map1texturecoord2 map1texturecoord3 map1texturecoord4 map1vertex3 map1vertex4 map2color4 map2normal map2texturecoord1 map2texturecoord2 map2texturecoord3 map2texturecoord4 map2vertex3 map2vertex4 modelview modulate mult nearest never none normalize notequal objectlinear objectplane one oneminusdstalpha oneminusdstcolor oneminussrcalpha oneminussrccolor packalignment packlsbfirst packrowlength packskippixels packskiprows packswapbytes pixelmode pixelmodebit point pointbit points polygon polygonbit polygonstipple polygonstipplebit position projection q quadraticattenuation quads quadstrip r redbias redscale render repeat replace return right s scissor scissorbit select shininess smooth specular spheremap spotcutoff spotdirecion spotexponent srcalpha srcalphasaturate srccolor stenciltest stencilbuffer stencilbufferbit t texture texture1d texture2d texturebit texturebordercolor textureenv textureenvcolor textureenvmode texturegenmode texturegens texturegent texturemagfilter textureminfilter texturewraps texturewrapt transform transformbit triangles trianglefan trianglestrip unpackalignment unpacklsbfirst unpackrowlength unpackskippixels unpackskiprows unpackswapbytes viewport viewportbit zero
You can find more information about standard OpenGL functions in a guide to OpenGL.
|
GiD_Set <varname> ?<value>?
This command is used to set or get GiD variables. GiD variables can be found through the Right buttons menu under the option Utilities -> Variables:
- <varname> is the name of the variable;
- <value> if this is omitted, the current variable value is returned (analogous with 'GiD_Info variables <varname>').
Example:
GiD_Set CreateAlwaysNewPoint 1
GiD_SetModelName <name>
To change the current model name.
GiD_ModifiedFileFlag set|get ?<value>?
There is a GiD internal flag to indicate that the model has changed, and must be saved before exit.
With this command it is possible to set or get this flag value:
- <value> is only required for set : must be 0 (false), or 1 (true).
Example:
GiD_
ModifiedFileFlag set 1
GiD_
ModifiedFileFlag get
GiD_MustRemeshFlag set|get ?<value>?
There is a GiD internal flag to indicate that the geometry, conditions, etc. have changed, and that the mesh must be re-generated before calculations are performed.
With this command it is possible to set or get this flag value:
- <value> is only required for set : must be 0 (false), or 1 (true).
Example:
GiD_MustRemeshFlag set 1
GiD_MustRemeshFlag get
Some special commands exist to control the redraw and wait state of GiD:
.central.s disable graphics 'value' The value 0/1 Enable/Disable Graphics (GiD does not redraw)
EXAMPLE to disable the redraw:
.central.s disable graphics 1
.central.s disable graphinput 'value' The value 0/1 Enable/Disable GraphInput (enable or disable peripherals: mouse, keyboard, ...)
EXAMPLE to disable the peripherals input:
.central.s disable graphinput 1
.central.s disable windows 'value' The value 0/1 Enable/Disable Windows (GiD displays, or not, windows which require interaction with the user)
EXAMPLE to disable the interaction windows:
.central.s disable windows 1
.central.s disable writebatch 'value' The value 0/1 Enable/Disable writting the batch file that records the commands send to be processed.
.central.s waitstate 'value' The value 0/1 Enable/Disable the Wait state (GiD displays a hourglass cursor in wait state)
EXAMPLE to set the state to wait:
.central.s waitstate 1
Usually these command are used jointly:
EXAMPLE
#deactivate redraws, etc wit a widget named $w
$w conf -cursor watch .central.s waitstate 1
update
.central.s disable graphics 1
.central.s disable windows 1
.central.s disable graphinput 1
...
#reactivate all and redraw
.central.s disable graphics 0
.central.s disable windows 0
.central.s disable graphinput 0
GiD_Redraw
$w conf -cursor ""
.central.s waitstate 0
Note: It is recommended for a Tcl developer to use the more 'user-friendly' procedures defined inside the file 'dev_kit.tcl' (located in the \scripts directory). For example, to disable and enable redraws, you can use:
::GidUtils::DisableGraphics
::GidUtils::EnableGraphics
GiD_Thumbnail get [ width height ]
returns the byte stream of an downscaled view of the graphical window. The image is a downscaled from the current size to width x height. The parameters widht and height are optinal and by default the view is scaled to 192x144. The result of this command can be directly used by the Tk image command, like this:
label .l -image [ image create photo -data [ GiD_Thumbnail get]]
write_calc_data init|end|puts|coordinates|all_connectivities|connectivities|nodes|elements|has_elements
This is a procedure to aid to write the calculation file from tcl as alternative as the classical .bas template
- init <filename> To open the calculation file
- end To close the calculation file
- puts ?-nonewline? <string> Print the string in the calculation file. -nonewline avoid the carriage return.
- coordinates ?-count? <format> Print <num> <x> <y> <z> for each node of the mesh.
Format must be a "C-like" format for an integer an three doubles.
If -count is specified then only return the number of entities, without print.
- all_connectivities ?-elemtype <etype>? ?-count? <format>
Print the element number and its connectivities for each element of type <etype> of the mesh (all types if -elemtype is not set)
<etype> can be: Linear|Triangle|Quadrilateral|Tetrahedra|Hexahedra|Prism|Point|Pyramid|Sphere
if -count is specified then only return the number of entities, without print.
- connectivities|nodes|elements|has_elements ?-elemtype <etype>? ?-localaxes <groupsLADict>? ?-elements_faces all|elements|faces? ?-number_ranges <NRDict>? ?-count? <groupsDict>
To get entities information related to groups: connectivities, nodes ,elements, of if exists some element of the specified group
<etype> can be: Linear|Triangle|Quadrilateral|Tetrahedra|Hexahedra|Prism|Point|Pyramid|Sphere
<groupsLADict> is a dictionary (list of pairs key value) of local axes, with key=LA_name and value=format
-elements_faces can be set to specify any type, body elements or face elements
<NRDict> is a dictionary of number of ranges
<groupsDict> is a dictionary (key=group value=format)
if -count is specified then only return the number of entities, without print.