Jump to content
Developer Wiki and Function Reference Links ×

How to do a 3 pt tool similar to the callout Tool?


ionw

Recommended Posts

I am currently moving all our reference annotations from 2D static symbols to auto-scaling PIO's. All of the actual annotations are currently done, but now I am trying to pull a Emeril Lagasse, you know, "Kick it up a notch!"

I want to add the ability to do markers to our reference note tool, and a 'tail' to our detail bubble. These are three point paths, exactly like the callout tool.

I was able to get this tool to work for two points, but three has sent me for a loop. I tried to use GetPt(x,y) three times with 3 sets of variables, which gave me the three click input, but then could not seem to use those coordinates to draw my line. Also it then blocked the creation of the rest of my object. So my assumption is I am using these tools wrong.

In the end what I want to do is this:

1. click to set the center of the marker

2. click to define the shoulder

3. click to define the endpoint.

4. draw the text for the marker

5. draw the marker RRect width is based on text width

6. draw the 'tail' as two lines section-one from (x1+1/2 marker width,y1) to (x2,y2) and section two from (x2,y2) to (x3,y3).

7. Moveto (x2,y2) and draw two parallel lines offset from the end of the tail.

As I pointed out, I was able to do all of this if I use it as a linear tool, and use the two points defined in the creation of that tool. It is when I go to three points that it falls apart.

Does anybody have any suggestions?

thanks in advance,

ion

Link to comment

It sounds like you'll have to have two plug-ins: one that is a tool, and the other that is an object. Just use the tool to collect the points, and then call CreateCustomObjectN to create an instance of the object using the points that you have collected. Objects have nice, but limited, built-in creation behaviors. If you want anything fancier than the standard point, line, box, etc. behaviors, it's easier to just to a separate tool.

Link to comment

Ok, I get what you are say Charles, and can see, I think how to progress using your method.

Petri, I am intrigued by what you propose, but do not have enough experience scripting VW to understand how to deine what you are proposing. Could you please elaborate a little?

many thanks,

ion

Link to comment

Ion,

You could have a Point object with two Control Points. (Or a Line object and one.)

With the Point object, you would draw a line from (0,0) to the first point (x1, y1), then to the second point (x2, y2). Alternatively, you might just use the y value of the first and x value of the second (or whatever combination) should you want to have a fixed angle or length for the lines.

While in the script/object, you use the object's internal coordinate system in which its insertion point in the drawing is (0,0 [,0]). The displayed values of control points are in "world" coordinates, so you will want to suppress them with the double underscore in their names.

I guess I'm not exactly lucid?

Just define two parameters of type Control Point. The user interface will be surprisingly straightforward. In the script their values are be called PCONTROLPOINT01X, PCONTROLPOINT01Y, PCONTROLPOINT02X and PCONTROLPOINT02Y (or thereabouts, can't remember the exact syntax).

The default values again must be in the PIO system.

B-ger... It's not this difficult!!!

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...