Formulas extracting object properties: length, radius, arc sweep,
Dx/Dy distances, and line slope
Use the formulas in this page to extract the following properties
of objects: length, radius, arc sweep, Dx/Dy distances, and line slope.
NOTE: All the formulas that follow require that
you supply the name (ID) of the object whose property you want to
extract. Here's how to do this: (1) To see the name (ID) of
a discrete object: Place the mouse cursor on the object. Do not click.
The object becomes highlighted. Then look at the lower left corner
of the application's window. (2) To see the name (ID)
of an object in a Synergy component: Press and hold down CTRL+SHIFT,
and then place the mouse cursor on the object. Do not click. The object
becomes highlighted. Then look at the lower left corner of the application's
window. The pictures below show you where to look for these
IDs.
Use in practice
In the expression of components
Consider the following example, which uses the objsize
function. The example explains the use of the formula in the expression
of a component. The height of the rectangular panel equals the dimension
that extracts the length of the edge of the triangular panel (Slope1).
The formula
To extract |
Use |
The length of an object |
OneupN.objlen("name") |
- THE PARAMETER
- name The name (ID) of the object whose length
you want to extract.
Examples
The examples that follow show you how to extract the lengths
of discrete objects and objects in Synergy components.
To extract the length of |
Use |
Example |
A line with name L1 |
OneupN.objlen("L1") |
100.00 |
A fillet with name F6 |
OneupN.objlen("F6") |
31.42 |
A circle with name C8 |
OneupN.objlen("C8") |
15.71 |
An arc in a component with name ASC5.A27 |
OneupN.objlen("ASC5.A27") |
10.09 |
You can use a formula to extract the radius of a circular object.
The formula
To extract |
Use |
A radius |
OneupN.objradius("name") |
- THE PARAMETER
- name The name (ID) of the object whose length
you want to extract.
Examples
The examples that follow show you how to extract a radius.
To extract the radius of |
Use |
Example |
A fillet with name F7 |
OneupN.objradius("F7") |
20.00 |
A circle with name C8 |
OneupN.objradius("C8") |
2.50 |
An arc in a component with name ASC5.A27 |
OneupN.objradius("ASC5.A27") |
6.00 |
Use the following formula to extract the sweep of an arc. NOTE:
When drawing an arc counterclockwise (left), the value is positive;
when drawing clockwise (right), negative (pictured).
The formula
To extract |
Use |
The sweep of an arc |
OneupN.objsweep("name") |
- THE PARAMETER
- name The name (ID) of the object whose sweep
you want to extract.
Examples
To extract the sweep of |
Use |
Example |
An arc in a component with name ASC5.A27 |
OneupN.objsweep("ASC5.A27") |
96.38 |
Use the following formula to extract an object's Dx and Dy distance
values. NOTE: You see these distances each time you are drawing
an object or have selected one: the program displays the Dx and
Dy distance values in the contextual edit bar.
The formula
To extract |
Use |
Dx, Dy |
OneupN.objsize("object ID", "case") |
- THE PARAMETERS
- name The name (ID) of the object whose Dx/Dy
distance values you want to extract.
- case The object's bounding rectangle distances
as follows: boundh for Dx; boundv
for Dy.
- Know your list separator: When typing a formula, make sure you separate
its elements with your computer's list
separator symbol. Yours may be different from the one used in this
guide. Examples (in red):
With Semicolon |
With Comma |
$Layout1.Length(Cutting; m; yes);
n2$ |
$Layout1.Length(Cutting, m, yes),
n2$ |
Examples
To extract |
Use |
Example |
Dx of a line with name L1 |
OneupN.objsize("L1"; "boundh") |
20.00 |
Dy of a line with name L1 |
OneupN.objsize("L1"; "boundv") |
25.00 |
Dx of an arc with name A2 |
OneupN.objsize("A2"; "boundh") |
31.47 |
Dy of an ellipse with name E4 |
OneupN.objsize("E4"; "boundv") |
12.00 |
Use the following formula to extract the slope (angle) of a
line.
The formula
To extract |
Use |
Dx, Dy |
OneupN.objsize("name", "slope") |
- THE PARAMETERS
- name The name of the line whose angle values
you want to extract.
- slope extracts line’s slope (angle).
- Know your list separator: When typing a formula, make sure you separate
its elements with your computer's list
separator symbol. Yours may be different from the one used in this
guide. Examples (in red):
With Semicolon |
With Comma |
$Layout1.Length(Cutting; m; yes);
n2$ |
$Layout1.Length(Cutting, m, yes),
n2$ |
Examples
To extract the slope of |
Use |
Example |
A line with name L1 |
OneupN.objsize("L1", "slope") |
45 |
A line in a component with name ASC5.L3 |
OneupN.objsize("ASC5.L3", "slope") |
57.15 |
Use the following formula to extract the distance between a
circle and a line.
The formula
To extract |
Use |
Distance between a cicle and a line |
OneupN.objdist("circle name1", "line name2",
"case") |
- THE PARAMETERS
- circle name1 The name of a circle
- line name2 The name of a line
- case [min, max], where "min" and "max"
are the minimum and maximum distances between the objects.
- Know your list separator: When typing a formula, make sure you separate
its elements with your computer's list
separator symbol. Yours may be different from the one used in this
guide. Examples (in red):
With Semicolon |
With Comma |
$Layout1.Length(Cutting; m; yes);
n2$ |
$Layout1.Length(Cutting, m, yes),
n2$ |
Example
To extract |
Use |
Example |
Distance C1–L2 (min) |
OneupN.objdist("C1"; "L2"; "min") |
14.93 |
Distance C1–L2 (max) |
OneupN.objdist("C1"; "L2"; "max") |
64.93 |
Use the following formula to extract the distance between control
points.
The formula
To extract |
Use |
Distance between control points |
OneupN.objdist("name1", "name2", "case") |
- THE PARAMETERS
- name1 The name of a control point
- name2 The name of a control point
- case ["", "h", "v"],
where "" is the distance between the control
points, "h" is the horizontal distance between
the control points; and "v" is the vertical
distance between the points.
- Know your list separator: When typing a formula, make sure you separate
its elements with your computer's list
separator symbol. Yours may be different from the one used in this
guide. Examples (in red):
With Semicolon |
With Comma |
$Layout1.Length(Cutting; m; yes);
n2$ |
$Layout1.Length(Cutting, m, yes),
n2$ |
Examples
To extract |
Use |
Example |
Distance L1.beg–L2.beg |
OneupN.objdist("L1.beg"; "L2.beg";
"") |
33.37 |
Horizontal Distance L1.beg–L2.beg |
OneupN.objdist("L1.beg"; "L2.beg";
"h") |
29 |
Vertical Distance C1.beg–L2.beg |
OneupN.objdist("L1.beg"; "L2.beg";
"v") |
16.50 |
Use the following formula to extract the angle between objects.
The formula
To extract |
Use |
Angle between objects |
OneupN.objangle("name1", "name2", "case") |
- THE PARAMETERS
- name1 The name of an object
- name2 The name of an object
- case ["", "beg1", "beg2",
"end1", "end2"], where ""
is applicable for lines and control points, "beg1"
applicable for arcs only) beginning of name1; "beg2"
–(arcs only) the beginning of name2; "end1"
– (arcs only) end of name1; "end2" – (arcs only)
end of name2.
- Know your list separator: When typing a formula, make sure you separate
its elements with your computer's list
separator symbol. Yours may be different from the one used in this
guide. Examples (in red):
With Semicolon |
With Comma |
$Layout1.Length(Cutting; m; yes);
n2$ |
$Layout1.Length(Cutting, m, yes),
n2$ |
Example: Extracting angle values
In the picture, the objects are as follows:
Object ID |
Description |
ASC197.L10 |
Line 10 in component ASC197 |
ASC195.L38 |
Line 38 in component ASC195 |
ASC195.L40 |
Line 40 in component ASC195 |
ASC197.L9 |
Line 9 in component ASC197 |
The extracted angles depend on:
- the order of object's ID are supplied to the function.
- the direction of drawing the objects: clockwise, counterclockwise.
As a result, you receive the following result depending on how
you write the function:
To extract |
Use |
Example |
ang1 |
OneupN.objangle("ASC195.L38"; "ASC197.L10";
"") |
29.30 |
ang2 |
OneupN.objangle("ASC197.L10"; "ASC195.L38";
"") |
330.70 |
ang3 |
OneupN.objangle("ASC197.L9"; "ASC195.L40";
"") |
209.30 |
ang4 |
OneupN.objangle("ASC195.L40"; "ASC197.L9";
"") |
150.70 |
Example: Extracting angles between tangential lines
To extract |
Use |
Example |
ang |
OneupN.objangle("A57.end"; "A458.beg";
"") |
154.64 |
ang1 |
OneupN.180-objangle("A57.end"; "A458.beg";
"") |
25.36 |