Skip to main content
1-Visitor
April 18, 2012
Question

Can you find and change line positions in callouts within macros?

  • April 18, 2012
  • 1 reply
  • 6300 views

We add lots of callouts to our illustrations and nearly always have to zoom in to each one to move the end of the leader line slightly away from the geometry to make it look cleaner.

I want to do a macro to move callout lines away from geometry automatically, but I need to know the start and end points of the callout to do this. I presume that when you select a callout, Isodraw knows where the start and end points of the leader line are but I don't know how to access this information.

Anyone know if it's possible?

1 reply

1-Visitor
April 19, 2012

You can retrieve text, line and background shape of callouts as their children. E.g.:

Message activeDoc.firstSelectedElement.lastChild.line.startPoint.x

prompts the x coordinate of the startpoint if one callout was selected.

Unfortunately these values are read-only. Maybe you can get around this

by creating a new callout that replaces the existing one and copy its values?

TimSharp1-VisitorAuthor
1-Visitor
April 19, 2012

Thanks for your help. I can find the start point of the callout with this method no problem, but when I try doing the end point using

activeDoc.firstSelectedElement.lastChild.line.segments[1].endPoint.x

I get an "Unknown macro command" error. I presume the syntax isn't right somewhere.

Your suggestion to replace callout with new ones will hopefully work for me.

1-Visitor
April 19, 2012

For me the syntax works exactly as you wrote above.
You should doublecheck if the callout is really selected (and no other elements are).

Please note that some callouts might not have a leader line at all, and you can not rely on the fact

that the line is always the last child (check the type of lastChild, firstChild, firstChild.nextSibling and so on.)