- Create a Representation containing 3 points.
- From the Compass, click 3D Modeling
Apps
, and select Engineering Rules Capture.
- Click List
to create the list that will contain the created points. - Add a formula to complete the list.
- Click Formula
from the Tools section. The
Formulas editor appears. In the tree, select List.1 and click Add formula. - Enter the following formula:
List.1=PartBody.Query("Point", "") . Click
OK three times when done.
- Click Reaction
.
The Reaction dialog box opens. - In the Source type box, select
Selection and select the list in the tree for the reaction to be applied when the list is
modified.
- In the Select a source... dialog box,
select List.1 and click OK.
- In the Available events list, select
ValueChange.
- In the Action box, select Knowledge
action and enter the following message action
body:
let x(Point)
for x inside parameter
{
if (x.GetAttributeReal("Z") < 0.02)
x.SetAttributeReal("Z",0.02)
} - Click OK when done.
The reaction feature
is added to the Relations node.
- Click Reaction
.
The Reaction dialog box opens.
- In the Source type box, select
Selection and select the list in the
tree for the reaction to be applied
when the list is modified.
- In the Select a source... dialog
box, select List.1 and click OK.
- In the Available events list, select
ValueChange.
- In the Action box, select
Knowledge action and enter the following message
action body.
let i =1
let x(Point)
for i while i<=parameter.Size()
{
x = parameter.GetItem(i)
if (x.GetAttributeReal ("Y") < 0.04)
x.SetAttributeReal ("Y",0.04)
}
- Click OK when done. The reaction is added to the Relations node.
- Create a point with the following coordinates:
X: 36mm
Y: 12mm
Z: 0mm
- Update the representation twice. The Y and Z coordinates
are set to 40 and 20 mm.
Note:
It is possible to use the While and the For constructs.
|