Assign conditions

Moderator: GiD Team

Post Reply
eduardrocas
Posts: 30
Joined: Thu Dec 11, 2014 2:34 pm

Assign conditions

Post by eduardrocas »

Hello,

I'm trying to assign conditions to entities, through Tcl code, with a command as follows:

GiD_Process Mescape Data Conditions Assign Indicator-to-Lines value 1:4 escape

The problem is that the condition "Indicator-to-Lines" has many different flags that can be either 0 or 1. So how can I assign flags-conditions values through Tcl? With the current command it doesn't care the "value" I use; it puts it to zero.

By the way, where can I find a "commands list" for GiD? Sort of a reference manual, with all commands and arguments?

Thanks,
Eduard
User avatar
escolano
Posts: 1922
Joined: Sun Sep 05, 1982 10:51 pm

Re: Assign conditions

Post by escolano »

The syntax of the GiD process command to assign a condition with n question fields to some entities is:

Code: Select all

Mescape Data Conditions AssignCond <condition_name> Change <value_1> ... <value_n> <entities_selection> escape
In your case, for example, with a condition named 'Indicator-to-Lines' with for example two fields and to be assigned to the lines with ids from 1 to 4 (lines, assuming that this condition is defined as over lines) from Tcl is something like this

Code: Select all

GiD_Process Mescape Data Conditions AssignCond Indicator-to-Lines Change value_1 value_2 1:4 escape
It exists also another GiD-tcl direct (without process) that allow assign conditions: GiD_AssignData
e.g. in you case something like this

Code: Select all

GiD_AssignData condition Indicator-to-Lines lines {value_1 value_2} 1:4
Note: commands that doesn't use process won't be registered by 'Undo'

About the documentation:
  • special GiD-Tcl commands like GiD_AssignData are docummented in GiD customization manual->TCL and TK extension
  • process keywords are not docummented anywhere, but GiD itself is its source of documentation: keywords are organized as a tree: the sub-words exists depending of the previous word.

    A way to see the words is to visualize the 'right buttons', hidden by default: Utilties->Tools->Toolbars...
    Select 'Rigth buttons' and click 'Inside', then the buttons show the keywords allowen by the 'current tree state'.

    But the best way to know a command is to use the command 'as user' and show the 'Undo window' (Utilities->Undo...) that show the used words.
eduardrocas
Posts: 30
Joined: Thu Dec 11, 2014 2:34 pm

Re: Assign conditions

Post by eduardrocas »

Very useful reply.

It's very convenient having the "right buttons" toolbar!

Thanks again,
Eduard
Post Reply