Project: HiCAD Feature Technology

 

Variables: Notes (Script Execution Example)

Until now, the parametrics area has had part variables. When a variable is used, the system searches for the variable in the direction of the root in the part structure, starting with the part in which the variable is used. Log variables are a new addition. When the system searches for a variable, the log variables are considered first and then the part structure as before. The log variables of other parts are not considered in the part structure.

Why are the log variables needed?

While part variables can be read in scripts, they cannot be changed. Log variables can be read and changed. This distinction is based on the following consideration:

When calculating an assembly, a variable v which is defined in main part A0 is used in part A1. For sub-part B1 of A1, variable v is then changed in the script. When the assembly is next calculated, A1 is now calculated with the new value of v and changes as a result. Behaviour in large assemblies would be difficult to understand.

Log variables are designed for saving calculation results from scripts.

To be able to set the value of a log variable in a script, the variable needs to be defined on the part in advance. (Right-click the feature and then the Local Variables function of the variant). During recalculation, the log variables are set at the beginning to the value defined in the variable table in order always to have the same initial value.

The variant variables are used to exchange data within the various design variant features which are created when a variant is fitted. In a concrete example, the initial facet of the first part is required to calculate the angle when adding the second flange. However, it can no longer be derived from the edge in the first part, as this edge no longer exists. (As an alternative to the facet, it would also have been possible to note the angle directly.)

The variant variables can only be accessed in the script.

© Copyright 1994-2019, ISD Software und Systeme GmbH
Version 2402 - HiCAD Feature Technology
Date: 06/10/2019

> Feedback on this topic