Step 1: Modifying a Measure

The Dart Test project is opened.

Open in the Style Manager the Toga style and from there, open the Logic form via Menu / Points / Logic. This logic form is connected to the style Toga, it is therefore important to make the logic in the right style!

In the Logic form: Click:                New Step

The Steps form opens. Select : Dart Depth < 2 The name of the step is a result of selecting the values

Click: OK The Step is visible in the Logic form

In the Logic form, add a new result to go with this condition:

===

Highlight the Step

if 2 > Dart Depth

Click

New Result

===

The Edit measure form opens.

===

Highlight

Dart Depth

Click

OK

===

The Math form of Dart Depth opens. Dart Depth is defined as 1/6 of the calculated Distance Measure Dist 1-3.  Change the measure to 0:

===

First Measurement

(None)

Click

OK

===

In the Logic form the result is:

Testing our logic

If we change the default height and width of our square, the piece display updates to show the current line of logic. Remember that the dart depth depends on the Height and Width.  If we change Width to a value such that Dart Depth goes below 2, we should see the dart disappear in the piece display—​a quick test without running the macro.

Open the style Toga.

.Measure / Edit

===

Highlight

Width

Click

Edit

Value

6

Click

OK

===

Arranging If Points in Order

This is wrong.  We told it if Dart Depth is less than 2, to set Dart Depth to zero.  Yet Dart Depth is 1.94.  Why is this?  The reason is subtle but important.  It has to do with the order of our logical steps.  By default, the If points are calculated after the measurements are typed in by the user.  This happens before any of the drawing points are calculated.  Yet Dart Depth is dependent on the distance between points 1 and 3.  We need to place the If Point after the creation of Point 3.

.Point/If Point

===

Check

Show all points

===

You used this dialog box in Tutorial 3, but with "Show All Points" unchecked.  Now all the point calculations are shown in the order in which they happen.  Drawing point calculations are in red, If points are in black.  Here we see that our If point happens before point 3 is calculated.  Use the big black arrows on the left of the dialog box move it down in the list.

===

Highlight

if 2 > Dart Depth

Click the down arrow 3 times

===

 

Click Ok

This gives us:

This is what we expected.  This is the first way to create an "if" condition.

Your project  should now be the same as the one in project file Dart Measure.mg4.

results matching ""

    No results matching ""