Import/Export of Document Variables

Предыдущая страницаВ началоСледующая страница

The main way of connecting T-FLEX CAD with some external procedures (especially design or calculation programs) is to transfer parameter values. Moreover, you can both transmit data and receive it.

This is accomplished with a ".par" parameter file.

Files of parameters can be used when you need to save several versions of the same drawing. In this case you save several files of parameters with the values of external variables and, if necessary, read the values from a specific file. As a result, a finished drawing with the required parameters is obtained.

It is convenient to use the files of parameters for connection of the T-FLEX CAD with other computational software. In the system you can create a parametric drawing with certain set of parameters. Your computational procedure receives the values of these parameters through the file. You calculate the remaining parameters of the drawing in your software and create either a new file of parameters or update the old one. From the T-FLEX CAD you read the file and obtain a modified drawing on the basis of the parameters calculated by you. Thus, the file of parameters serves as an intermediate link for connection between the T-FLEX CAD and your software.

Saving variables to external file

The values of variables can be written into the file of parameters by using the Save command:

TextSave20x20

<Ctrl>+<W>

File > Export…

WriteParameters1

After starting the command, a dialog for saving variables appears, in which you can specify the path to save the file with parameters and export settings.

VariablesEditor46

The comment is written on condition that one of the following parameters has been set on With Expressions or With Comments.

If in the export dialog box the flag Marked Only is activated, then only external variables of the given document will be written into the resulting file. When the flag is taken off, all visible variables are exported.

Hidden variables are not exported by default. In order to write them into the external file as well, it is necessary to set on the flag Export Hidden Variables.

For example, suppose there is the following list of variables in the editor:

VariablesEditor47

When writing the file, the following parameters were set: With Expressions, With Comments. The result should be a ".par" file with the following content (you can open it with any text editor):

 

b = 100; /*Width*/

a = 9; /*Length*/

c = a+b; /*Sum*/

aa = (#1+#2)*10+3; /*Function*/

$IT = "Text"; /*Text*/

f = aa(3,4)*10+200; /*Variable f*/

 

If you select Export Connector Values, the output file will have values added from the corresponding column.

If you select Export Only Selected Variables, the output file will have only selected rows.

If you select Export Group Names option, the names of the corresponding groups will be added to the file.

Loading an external variable file

The values of external variables can be read from the parameter file using the Load command:

TextLoad20x20

<Ctrl>+<R>

File > Import...

ReadParameters1

After starting the command, a dialog for reading variables appears, in which you can specify the path to save the file with parameters and import settings.

VariablesEditor50

Replace Comments – replaces comments when the variables in the editor and the imported file match.

Create New Variables – adds variables that are only present in the imported file.

Only Marked Variables – only adds variables marked as external in the imported file.

Load Connectors - adds information about the connectors specified in the Connector Values option in the variable parameters.

Group Variables - allows you to take into account the names of groups specified during export.

See Also:

Printing List of Variables