Constrain the move of a hotspot2 along a line ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2011-12-17 11:54 PM
With something like this, I can move a point C (editable hotspot2) on all directions :
!x
HOTSPOT2 Cx, 0, ID, Cy, 1+128 : ID=ID+1
HOTSPOT2 Cx, -1, ID, Cy, 3 : ID=ID+1
HOTSPOT2 Cx, Cy, ID, Cy, 2 : ID=ID+1
!y
HOTSPOT2 0, Cy, ID, Cx, 1+128 : ID=ID+1
HOTSPOT2 -1, Cy, ID, Cx, 3 : ID=ID+1
HOTSPOT2 Cx, Cy, ID, Cx, 2 : ID=ID+1
How can I force the displacement of the point C along the line D ?
C is halfway between A and B.
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2011-12-18 04:39 AM
Basically, you write a group of three hotspot2 commands to get a single moving hotspot constrained to a line. You just need to know the equation for your particular line.
You could also look at simplifying things depending on the know variables, or by writing your hotspot for a simple case (ie. vertical or horizontal lines) and then rotate your coordinate system.
HTH
AC 19 6006 & AC 20
Mac OS 10.11.5
15" Retina MacBook Pro 2.6
27" iMac Retina 5K
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2011-12-18 11:36 AM
Erich wrote:Merci Erich.
There are a number of ways to accomplish this. What are your known variables? delta_x? delta_y? The angle of line "D"?
Basically, you write a group of three hotspot2 commands to get a single moving hotspot constrained to a line. You just need to know the equation for your particular line.
You could also look at simplifying things depending on the know variables, or by writing your hotspot for a simple case (ie. vertical or horizontal lines) and then rotate your coordinate system.
HTH
All my known variables are in the drawing (A, B, C, O and a point (E) between A and B).
So I have 2 points O and E on the D line.
I can get the D line equation.
How can I use it in the hotspot2 ?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2011-12-18 03:00 PM
Try in the master or value script;
parameters b= (-a)
HTH, Juha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2011-12-18 03:25 PM
and rotate it before declaring;
rot2 -45
hotspot2 xxx-direction...
hotspot2 xxx-direction...
hotspot2 xxx-direction...
del 1
Regards, Juha

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2011-12-18 04:12 PM
Start by determining your angle for the line AB. Assume that the origin passes through your point E. Then your angle is ATN (Ay/Ax). You many need a special case for when your angle is 90 or 270 degrees as the tangent blows up there.
Next, write your hotspots in only the vertical direction with an angle transformation before it. You would have something like this:
IF Ax<>0 THEN ang = ATN(Ay/Ax) ELSE ang = 90 !! it could also be ang = 270 ENDIF ROT2 ang HOTSPOT2 0, Cy, ID, Cx, 1+128 : ID=ID+1 HOTSPOT2 -1, Cy, ID, Cx, 3 : ID=ID+1 HOTSPOT2 Cx, Cy, ID, Cx, 2 : ID=ID+1 DEL 1
AC 19 6006 & AC 20
Mac OS 10.11.5
15" Retina MacBook Pro 2.6
27" iMac Retina 5K
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2011-12-18 10:24 PM
If I use the solution :
ROT2 angle
DEL 1
all points are in a wrong place, because I don't use a local coordinate system with ADD2 x,y for each point.
I'd rather another way, perhaps using the D line equation ?
With E (between A and B), and O (center of circle), I have two points on the line D.
with line equation : y = ax + b
I have :
a = (Ey - Oy) / (Ex - Ox)
b = Oy - aOx
What can I do after ?
Juha wrote:I don't understand
parameters b= (-a)

Best regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2011-12-19 02:18 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2011-12-19 04:32 PM
Olivier wrote:Thanks you for your example. I have understood how you do. But I'd like understand how works the editable hotspot. No french documentation for GDL, except the documentation AC 7.0, but without editable hotspot ! And the english documentation seem sketchy !
You need some trigo to find centre and radius of the arc, according to any location of your points.
See attached example.
Is there another way without ROT2 angle ?
Merci
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2011-12-19 05:42 PM
Thierry wrote:Graphical Hotspots are fully documented in each version since AC8. Goto Menu > Help > GDL Reference Guide> Graphical Editing,
Thanks you for your example. I have understood how you do. But I'd like understand how works the editable hotspot. No french documentation for GDL, except the documentation AC 7.0, but without editable hotspot ! And the english documentation seem sketchy !
or Online Help
Thierry wrote:I don't see the problem, you delete the transformation once done.
Is there another way without ROT2 angle ?
There are other ways to achieve the same result without using rot2, but calculations are more complicated.