Jump to content
AStein

User created reference points

Recommended Posts

Hey

I'm getting into custom plugins, but I'm definitely still a beginner as a power user here, so I appreciate how helpful this forum as been already. Thanks ahead of time Pat. You're a godsend on this forum!

 

What I'm trying to do:

I'd like to make a data record than can reference the VW Hoist origin tool so that I can attach it to any symbol and snag coordinates for layout and reporting easily. I currently use the hoist tool to do this, but it really chugs VW when I've got 300 1/4x size hoist symbols attached to a complicated layout and the art director wants to see what the set looks like rotated just "this" much... And again... And again... and VW hangs for a minute each time, I'm guessing, because the hoist tool has a ton of back-end braceworks-related things it's trying to do every time I nudge a point around?

 

 

Share this post


Link to post

You can do this fairly easily with data tags. The object functions Insertion Point X/Y will use the insertion point of the data tag if the tag isn't attached to the object. For example, your tag formula might be:

#IPX#, #IPY#

 

If you are providing measurements from a hoist origin that is not at 0/0, the data tag can't yet do that math. You would have to move the user origin to the point from which you want to take measurements.

Share this post


Link to post

I was going to recommend Data Tags also, but Josh beat me to it.

 

I thought @Sam Joness Autoplot Tools for Spotlight had a feature to dimension anything from a reference point. Definitely cheaper than the time you will spend learning, but if you want to learn we will be glad to help.

 

 

Share this post


Link to post

Thanks guys

 

I'll explore data tags. And point taken about the time-sink to go deep into this stuff.

 

I'm going to keep learning this stuff though, because ultimately I want to build a plug in that I can give to people in the company that kind of does everything we do.

 

Still trying to wrap my brain around how to get a custom tool to talk to another custom tool in a similar way to  how the hoist and origin tool do it.

Share this post


Link to post

The connection between the object is not that difficult if you only need a single reference point. If you need multiple reference points it will get slightly more complicated.

 

Easiest way would be to attach a record to the Reference Point and store a UUID into that field. The UUID is an unchanging reference to the object. Then store that same UUID in a field of the Referencing object. When the Referencing object needs to know where it is it just looks up the object with the same UUID and does the math to get the relative location from that point.

 

Vectorscript has a single line call to create the UUID. How you relate the Reference to Referencing objects is up to you. You could click on the reference point or show a pulldown list of all the available reference points.

 

If you really want to get fancy, you could even just make a single PIO object type and let the user choose if it is a reference or referencing point and display appropriately.

 

Dont' try to get too fancy to start. Just come up with a somewhat working prototype to see how it all goes together and then refine it from there.

 

Ask as you need more help.

Share this post


Link to post

Thanks Pat. Baby steps. Copt that. I'll start chewing on this.

Share this post


Link to post

The measure from a selected place, or user defined place is partly a chicken and egg problem.  With Hoists, the hoists have a parameter that holds a value naming a Hoist Origin PIO.  The hoist gets the location of the named hoist origin and does the math.  The math is done in the code that defines the hoist.

Pat is a great scripter, but I think we have to be clear about what it is likely that you will need to create.  I could be wrong, and it will be great to see what others come with.  I think you will need to create a script that does all the work and shoves the result into a record field of your choosing; records cannot do math by themselves.

1. Identify where you want to measure from.

     a) a selected object:  vs command "FSActLayer"

     b) a user click: vs command "GetPt"

     c) a known object like a Hoist Origin, but perhaps one you create.  Get it UUID, or give it a name, something unique and get the location of the object with that name

     d) some other location identification I haven't thought of

2. Select all the objects you want to which you want to attach the record.

3. Run the command that does the work

     a) It attaches the record to each of these objects.  ForEachObject() which will run a subroutine to attach the record 

     b) it then gets the location of each selected object and do the math and put the result in the record.  This will probably be done by the same subroutine above that attaches the record.

4.  Running the command a second time could, if desired, collect all the objects that already have the record, plus all the selected objects and perform the calculation and assignment work.  ForEachObject() a second time that uses the presence of the record as criteria instead of selection state.

 

Data Tags could be used to access the record.  Or, if only symbols are selected, text attached to the record could display the results.

 

The creating a command probably has the advantage of easily changing the measure from point, if desired, and is easily paired with Data Tag technology.

This is not your garden variety beginning script, but it will introduce you to several important concepts and commands that will be part of almost any other command you want to try and make. It is not rocket science, let us know what you come up with.  You got help from the 2 power teacher/scripters in Josh and Pat.

 

Share this post


Link to post

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.


 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...