Jump to content

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?

 

 

Link to comment

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.

Link to comment

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.

Link to comment

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.

Link to comment

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.

 

Link to comment
  • 3 weeks later...
  • 2 years later...
On 6/23/2021 at 8:13 PM, michaelk said:

@AStein This might do what you're looking for.

This is AMAZING! I wish I knew scripting so I could modify this myself but it would be super sweet to have a precicion dropdown like many other measurement tools where the measurements would Round to the nearest nth. Thank goodness for the manuel override inputs but it would greatly speed up the process. 

 

image.png.89966e1d84d62c26ff857f1dbac59e36.png

Link to comment

@Josh_M_Gill That is a really great feature request! 

 

If I ever get back to this tool I've gotten several really good feature request to implement.  

 

The other one I really like is the ability to work on rotated axes.  The example was 3 stages in a festival - each on a different axis.  It would be great if the tool could treat each stage axis as it's own universe.

 

 

  • Like 1
Link to comment
2 hours ago, michaelk said:

The other one I really like is the ability to work on rotated axes.  The example was 3 stages in a festival - each on a different axis.  It would be great if the tool could treat each stage axis as it's own universe.

 

Love this idea. Would love some advise. I often use the Base Point in the center of key witness points like pillars so that they can be used by several Dimmension points. only slight kerfuffle is that my measurements are slightly off base on the size of the opject. Not sure if there's an easy and obvious way I can fix this but would there be a way to use this tool like a plugin and link it to an object like tags? not sure if that would even solve the issue...

 

I could mark every corner of every pillar but that would put me past 120 Base Points.

 

image.png.87d2eac5916164e35c5c39ac83830072.png

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...