Variables
Object for variable handling
The 'Set...-functions' for the setting of variable values are only in the script features if the variable object has been initialised with the parameter- or local variables of a design variant. It is not permitted to modify part variables in the script features.
|
|
|
|
FUNC |
COM |
SF |
---|---|---|---|---|---|---|
GetRealVar |
Provides the value of a number variable. |
|
|
1211.1 |
1211.2 |
+ |
SetRealVar |
Sets the value of a number variable. |
|
|
1211.1 |
1211.2 |
+/- |
GetEdgeVar |
|
|
|
1211.1 |
1211.2 |
+ |
SetEdgeVar |
|
|
|
1211.1 |
1211.2 |
+/- |
GetFaceVar |
|
|
|
1211.1 |
1211.2 |
+ |
SetFaceVar |
|
|
|
1211.1 |
1211.2 |
+/- |
GetPartVar |
Provides a part variable. |
(String variablenName, Part& p) |
|
1211.1 |
1211.2 |
+ |
SetPartVar |
Sets a part variable. |
(String variablenName, const Part& p) |
|
1211.1 |
1211.2 |
+/- |
GetProfileVar |
Provides the value of a profile variable. |
(String variablenName, Profile& p) |
|
1211.1 |
1211.2 |
+ |
SetProfileVar |
Sets the value of a profile variable. |
(String variablenName, const Profile& p) |
|
1211.1 |
1211.2 |
+/- |
MakeVars |
Initialises the variable object with the variables of a part and its superior parts. You are working directly on these variables. The 'Get...'-functions provides the value for variables from the given part or if the variable is not defined at this part, from the next superior part where the variable is defined. The 'Set...'-functions set the value of the variables in the part tree. If the variable did not exist so far, it will be added to the part itself. |
(const Part& p) |
|
1211.1 |
1211.2 |
+ |
MakeVariantParameterVars |
Allocates the variable object with the parameter variables of a processing variant. This function can only be called in script features. Parameter variables cannot be changed. |
( ) |
|
1211.1 |
1211.2 |
+ |
MakeVariantLocalVars |
Allocates the variable object with the local parameter variables of a processing variant. This function can only be called in script features. |
( ) |
|
1211.1 |
1211.2 |
+ |
MakeVarsOfFile |
Allocates the variable object with the variables from the CSV file. |
|
|
1211.1 |
1211.2 |
+ |
WriteCSV |
Allocates the variable object with the variables from the CSV file. |
|
|
1211.1 |
1211.2 |
+ |
Edit |
Calls a window for the editing of a variable. If an image has been defined with 'SetPict', it will be shown in this window. |
int Edit ( ) |
Return: 0 = Abort |
1211.1 |
1211.2 |
- |
SetPict |
Defines a window for the edit window. |
void SetPict (String fileName) |
Picture file in BMP-format |
1211.1 |
1211.2 |
+ |
Example Variables
rem Hicad-path
$baseHicPath :=c:
rem additional path relative to'c:'
$addpath :=processing variants
rem Name of the variant
$name :=example1
rem obtain operating system path for HiCAD path
FUNC delete hicFN
FUNC HicFileName hicFN
FUNC hicFN.Set ($baseHicPath)
FUNC $basepath := hicFN.GetOSName()
FUNC delete hicFN
rem form variant name
$varnam:=$basepath+$addpath
$varnam:=$varnam+$name
rem ============ allocate variables of variant you want to add ============
rem -----------------------------------------------
rem create variable object, to enable calling the variable table
rem before loading the variant
rem and to transfer the entered numeric and in the graphics selected
rem object variables to the variant you want to add
rem -----------------------------------------------
FUNC delete variablen1
FUNC Variables variablen1
rem -----------------------------------------
rem determine variable allocation for numeric variables of the variant
rem from CSV-file
rem -----------------------------------------
rem define name of the allocation file (...CSV-Format)
$ext:=.csv
$fn := $varnam+$ext
rem take over variable allocation from the CSV-file into the variable object
FUNC variablen1.MakeVarsOfFile($fn)
rem --------------------------------------
rem show variable table with bitmap and allocated variables
rem --------------------------------------
$ext:=.bmp
$fn := $varnam+$ext
FUNC variablen1.SetPict($fn)
rem -------------------------
rem show variable table
rem -------------------------
FUNC %ret:=variablen1.Edit()
if ret=0 goto 99
rem ============ Add variant ============
rem ------------------------------------
rem creation of the object for the variant to be called with the
rem concrete variable allocations
rem ------------------------------------
FUNC delete variante1
FUNC Variant variante1
rem -----------------------------
rem define object for the variants (file)
rem -----------------------------
rem convert Hicad-file name into operating system file name
$ext:=.fmv
$n:= $varnam+$ext
rem set file name of the variant (operating system convention) in variant object
FUNC variante1.Define($n)
rem set pre-defined parameter of variable table in variant object
FUNC variante1.SetParameters(variablen1)
rem insert variant Variables will be queried which are not defined in 'vars2'.
FUNC variante1.insert()