30.07.2013 Views

T-FLEX Parametric CAD. Fundamentals. 2D Design

T-FLEX Parametric CAD. Fundamentals. 2D Design

T-FLEX Parametric CAD. Fundamentals. 2D Design

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

GLOBAL VARIABLES<br />

Global Variables<br />

A global variable is a named value of one of the two types: text (string) or real. Global variables are<br />

accessible for editing in the variable editor or via the special functions across all currently open documents.<br />

The list of global variables and their values are saved automatically upon exiting the application (in the<br />

registry) and are restored upon launching the application.<br />

Global variables are created by the command "SG: Create/Edit Global Variables". The command is<br />

called by one of the following means:<br />

Keyboard Textual Menu Icon<br />

“Parameters|Global Variables…”<br />

Upon calling the command, the dialog box is displayed on the<br />

screen where you can create new global variables or delete and<br />

edit the existing ones. To create a new variable, press the graphic<br />

button [New]. In the coming up dialog box defining the name,<br />

value and type of the variable being created.<br />

Upon the confirmation, the entered data will be displayed in the<br />

command dialog box.<br />

Created global variables will be stored until you delete those or<br />

update your system installation (the global variables are stored in<br />

the system registry). A global variable can be accessed from any<br />

document managed by one user.<br />

You can retrieve the value of a global variable in any dialog that<br />

allows use of variables, by the following special functions:<br />

getg (“Name”,N) – gets the value of a real global variable;<br />

tgetg (“Name”,N) – gets the value of a text global variable.<br />

The first argument defines the name of the created global variable.<br />

The expression after the comma defines the value to be used in the<br />

case if the global variable is not found.<br />

Exercise: create a new variable of a certain type (real or text) in<br />

the variable editor within a drawing, and then make a function call<br />

for accessing a global variable of this type. If the global variable<br />

with the specified name (“L”) exists in your user registry, then its<br />

value will be displayed in the “Value” column. If the specified<br />

global variable is not found then the second function argument<br />

will be displayed in the “Value” column.<br />

Besides that, a global variable can be created, or its value modified, in the common variable editor or in any<br />

dialog that allows use of variables. The following functions are provided for this purpose:<br />

setg (“Name”,N) – sets the value of a real global variable;<br />

tsetg (“Name”,N) – sets the value of a text global variable.<br />

521

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!