cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Loop triggered by mouseclick in Isodraw 7.3

sursachie
2-Explorer

Loop triggered by mouseclick in Isodraw 7.3

  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

ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

2 REPLIES 2

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

Announcements

Top Tags