Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
Hello, fellow Illustrators,
I'm trying to combine few drawing steps into a macro file for generating some hotspoted items.
The creation step is triggered by MouseClick and works fine but I cannot figure out how to make it prompt again for mouseclick. A "while" loop somehow...
The relevant code approach (without the changing attributes and so ..) would be:
Macro callout
define me as MouseEvent
define el as element
define ppx1 as Point
define ppy1 as Point
me = Wait MouseClick
ppx1 = me.ptMMGrid.x
ppy1 = me.ptMMGrid.y
Create Callout "Normal" ppx1 ppy1 ppx1 ppy1
select none
End Macro
Any hints would be appreciated.
Many thanks in advance
Seb
Solved! Go to Solution.
Not tested, but I believe this should work. If you left-click it should run your create callout function. If you right-click it should end the while loop.
Macro callout
define me as MouseEvent
define el as element
define ppx1 as Point
define ppy1 as Point
While (me.Click <> 2) |
If (myME.click = 1) Then
me = Wait MouseClick
ppx1 = me.ptMMGrid.x
ppy1 = me.ptMMGrid.y
Create Callout "Normal" ppx1 ppy1 ppx1 ppy1
select none
end if
End Macro
Not tested, but I believe this should work. If you left-click it should run your create callout function. If you right-click it should end the while loop.
Macro callout
define me as MouseEvent
define el as element
define ppx1 as Point
define ppy1 as Point
While (me.Click <> 2) |
If (myME.click = 1) Then
me = Wait MouseClick
ppx1 = me.ptMMGrid.x
ppy1 = me.ptMMGrid.y
Create Callout "Normal" ppx1 ppy1 ppx1 ppy1
select none
end if
End Macro
Hi Trevor,
Thanks for your quick reply,
Using the comparison operators did the job just fine. I've only changed the "Wait MouseClick" position and closed the while loop.
Completed with my "atributes changing" lines and it runs smoothly.
Thumbs up !
Macro callout
define me as MouseEvent
define el as element
define ppx1 as Point
define ppy1 as Point
While (me.Click <> 2) me = Wait MouseClick |
If (me.click = 1) Then
ppx1 = me.ptMMGrid.x
ppy1 = me.ptMMGrid.y
Create Callout "Normal" ppx1 ppy1 ppx1 ppy1
end if
end while
End Macro
Seb