Dart Test Project
Setting up
We’re going to create a macro that uses a few simple measurements to make a dart of variable width and depth. In the subsequent sections of this tutorial, we’ll use this dart to demonstrate various logical decisions. The set-up work in this section has already been done for you, so if you think you understand what follows and don’t need the practice, you can skip to the end of this section and open the project file "Tutorial - Dart Test.mg4".
Start new Project |
|
Settings/Metric |
checked |
Macro Title |
Dart Test |
Add Piece |
Toga |
Open the Toga style.
It will require two prompted measurements, Height and Width, and a math measurement "Dart Width" with a fixed distance 1.
Name |
Width |
Value |
10.0 |
Save the measurement at the left bottom. Click New
Name |
Height |
Value |
10.0 |
Save the measurement at the left bottom. Click Save at the right bottom to exit the form.
Name |
Dart Width |
First Measure |
(None) |
Second Measure |
(None) |
Fixed Distance |
1.0 |
Now we add some points to create a simple square.
Name |
1 |
From |
Start |
X Fix. Distance |
5 |
Name |
2 |
From |
1 |
X Measure |
Width |
X Scale |
1 |
Name |
3 |
From |
2 |
Y Measure |
Height |
Y Scale |
1 |
Name |
4 |
X Coordinate |
1 |
Y Coordinate |
3 |
The depth of the dart will be 1/6 of the diagonal measurement of our square. Create a Distance measurement named "Dist 1-3" which is the distance between Points 1 and 3.
Next create a Math measurement for the Dart Depth
Name |
Dist 1-3 |
From Point |
1 |
To Point |
3 |
Name |
Dart Depth |
First Measure |
Dist 1-3 |
First Measure scale |
6 |
Now, for the dart points. Create the following points:
Name |
DC |
From |
2 |
To |
3 |
Name |
D1 |
From |
Dart Center |
Y Measure |
Dart Width |
Y Divisor |
-2 |
Name |
D2 |
From |
Dart Center |
Y Measure |
Dart Width |
Y Divisor |
2 |
The apex of the dart:
Name |
D3 |
From |
Dart Center |
X Measure |
Dart Depth |
X Divisor |
-1 |
Note: As a little review of things we learned in Tutorial 2, notice the order of the events above: we had to create Points 1-3 before we could calculate the measure Dart Depth, and we had to calculate Dart Depth before we could add the dart points.
Create an object .Object / Add / New
Name |
Toga |
1 (Line) |
|
4 (Line) |
|
3 (Line) |
|
D2 (Line) |
|
D3 (Line) |
|
D1 (Line) |
|
2 (Line) |
|
Close |
checked |
OK |
The object looks like this:
You may open the MacroGen project file "Tutorial - Dart Test.mg4" now if you want to skip the above work.