The following figure shows you the variable definition in the object part.
Defining Variables
If you use a class to refer to an object, you use the expression IS_A to define a variable: X IS_A (300) T_FC00.
If you refer to an object using the object key, and do not enter a class, you use the expression IS_OBJECT to define a variable: Y IS_OBJECT (Material)(300)(NR=T-FC00).
Variables for the $self, $part, and $root instances are defined using the keyword AS: Z AS $SELF
If you use the object key to refer to an object, you must define a variable. If you use a class or an instance to refer to an object, defining a variable is optional.
You can enter a ? to make your variables easier to identify: ?X IS_A (300) T_FC00.
The variables referred to in a constraint must already be known when you create a constraint.
Constraint – Example without variables:
1234
OBJECTS: (300)T_FC498 ,
(300)T_FC598 .
CONDITION: (300)T_FC598.T_FC004 specified .
RESTRICTION: (300)T_FC598.t_FC003 = (300)T_FC498.t_FC022 .
Constraint – Example with variables:
1234
OOBJECTS: ?carr is_a (300)T_FC498 ,
?cab is_a (300)T_FC598 .
CONDITION: ?cab.T_FC004 specified .
RESTRICTION: ?cab.t_FC003 = ?carr.t_FC022.
Constraint – Example with characteristic variables:
123456
OBJECTS: (300)T_FC498 where wheels = T_FC022 ,
(300)T_FC598 where seat = T_FC003 ;
back = T_FC004 .
CONDITION: specified back .
RESTRICTION: seat = wheels.
The following figure shows you variable examples in the object part.
Advantages of variables:
It's entirely up to you whether you use variables or not. Variables are an option for supporting modeling. Characteristic variables can be used in conjunction with object variables and class variables.
Restrictions
Watch the following video explaining the Restrictions part of a Constraint.
In the RESTRICTIONS section of a constraint, you can also call tables that you defined previously. This makes a constraint a powerful tool, since you can replace a large number of preconditions by using a table call in a constraint.
You can also use tables to restrict the allowed range of values. For example, you can use a table call to define the value combinations for the mass height and drive type. If you refer to a table in a constraint, only the value combinations defined in the table are valid. Under LO-VC, you must use restrictable characteristics and the INFERENCES part for this.