Jump to content
Developer Wiki and Function Reference Links ×

Tool to Insert Symbols?


AlexClark

Recommended Posts

Hello, 

 

I'm a long time VW user, but I'm just starting to stumble my way into scripting. I've done some tinkering with C++ on Ardunio, but otherwise I'm a coding noob. 

 

I've got a good collection of symbols I've built myself and use in drawings regularly; things like drawing labels, lighting position labels, and lineset schedules. In a very basic sense, I'd like to create a tool that allows me to edit fields on these symbols from the Shape tab of the OIP, rather than having to go over to Data. But, while I'm at it, it would be cool to build it so that several variations of a symbol are available from a drop-down menu (something like the stock Center Line Tool or North Arrow Tool where different styles can be chosen). 

 

While the available resources have given me a decent understanding of the fundamentals of VS, I'm a bit lost on creating a symbol and getting something to write values to a record. I've also been playing around with Marionette (which looks super cool) and while I've made a script that will insert a symbol, I have not been able to get values to be written to the symbol's record.  I feel like this should be easier than it seems ...

Link to comment

A symbol is never going to be be able to have data accessible from the Shape pane. In order to do this you are going to need to create a PlugIn Object.

 

The basic idea is that you will create a "Parameter Record" that has fields similar to the ones in your custom record that you access through the data pane. You then use these "Parameters" in your script by prefixing the field names with "P" They then act just like other variables, but can be changed by the script.

 

I have attached a very simple PIO that shows an editable text field on the Shape pane. This PIO simply inserts a locus point and labels it with the custom text and the distance from the origin.

 

Drop the .VSO file into your User folder, Plug-ins and restart VW (Not necessarily required, but a good idea.) Then edit your workspace to include the new tool.

 

You can use the Tools:Plug-ins:Plug-in Manager to modify the object. Go to the Custom Plug-ins tab and you should see the Distance from 00 plug in listed. Click the Edit Script button to see the script. Click the Edit Definition button and go to the Parameters tab to see the parameters. Parameter 1 (Controlpoint01X and ControlPoint01Y) are automatically generated based on the type of Plug-in it is. The MyText is something I have added to have it show in the OIP.

 

The PIO is intended to be used at a scale of something like 1/4". If you use it at 1:1, the label will end up about 3" away from the locus point.

 

Hopefully this gets you started. Write back if you need more help.

Distance from 00.vso

Link to comment

I programmed Vectorscript for ten years before I finally delved into creating custom plugins.  I don't know why it took me so long. If you can write Vectorscript, it's pretty simple to create a custom plugin.  I've now created numerous tools for cabling, networking, racks, and others.  I did it for the same reason you are looking for: to have the info on the shape panel instead of the data panel.  And because with a plugin, you can do drop-down menus, checkboxes, enter actual dimensions, hide parameters based on others,  etc.  So much more versatile than data.

Link to comment
  • 2 years later...
On 12/6/2017 at 8:40 AM, Pat Stanford said:

A symbol is never going to be be able to have data accessible from the Shape pane. In order to do this you are going to need to create a PlugIn Object.

 

The basic idea is that you will create a "Parameter Record" that has fields similar to the ones in your custom record that you access through the data pane. You then use these "Parameters" in your script by prefixing the field names with "P" They then act just like other variables, but can be changed by the script.

 

I have attached a very simple PIO that shows an editable text field on the Shape pane. This PIO simply inserts a locus point and labels it with the custom text and the distance from the origin.

 

Drop the .VSO file into your User folder, Plug-ins and restart VW (Not necessarily required, but a good idea.) Then edit your workspace to include the new tool.

 

You can use the Tools:Plug-ins:Plug-in Manager to modify the object. Go to the Custom Plug-ins tab and you should see the Distance from 00 plug in listed. Click the Edit Script button to see the script. Click the Edit Definition button and go to the Parameters tab to see the parameters. Parameter 1 (Controlpoint01X and ControlPoint01Y) are automatically generated based on the type of Plug-in it is. The MyText is something I have added to have it show in the OIP.

 

The PIO is intended to be used at a scale of something like 1/4". If you use it at 1:1, the label will end up about 3" away from the locus point.

 

Hopefully this gets you started. Write back if you need more help.

Distance from 00.vso

 

Hello Pat, many thanks in advance.  I have been on and off on the forums with questions to help my workflow.  Creating a PIO to insert symbols has constantly been in the back of my mind with a few usages in mind.

 

I work in the entertainment industry and as such use Truss almost daily.  As I print the plots for install, I have found it useful for the end user if I had a plot with Truss Builds denoting what each stick of Truss is.  I currently am using a custom set of symbols for Truss and noticed if I insert the Truss Length into the symbol, I can turn the visibility on/off through the use of classes, however as I edit the symbol and need to rotate truss, the font gets rotated as well.  Through research, it has been suggested that by making a PIO that inserts my truss symbol, I can achieve class visible length markers that do not rotate with the truss.  Where can I gather more help on creating a PIO for this purpose?

 

Secondly, I had contacted Sam Jones about a possible PIO similar to the one you reference here.  I wanted to drop a locus point on my drawing that shows distance from origin, much like his Chain Hoist Tool shows distance from origin.  He mentioned needing to understand EventAware.  I just downloaded your example, but does your example do just this?

 

Thank you

Link to comment

@michaelk Do you want to jump in here?

 

I think a PIO to insert truss with all of the issues of connections, etc. is more that you want to jump into for a first Vectorscript project.

 

Perhaps a better project would be a script that would step through all the truss on the drawing and add a Data Tag that displays the length. I recommend that you look at the data tag and see if you get get it to display what you want. If you can, then we can probably help you with a script to place the tags.

Link to comment

@Pat Stanford  Hang on a second.  I fell off my chair.

 

@nippaz:  As someone who has been writing scripts for years and only recently started making parametric objects, I can tell you it's easier than you think it will be.  But it makes no sense (at least to me) until you see it done once.  @Pat Stanford walked me through it (on the phone?  email?  zoom?) a little over a year ago after a rehearsal one night.  Took about an hour.  After you get through that, it turns out there are another 32 degrees of difficulty to go through.  (I still can't make event aware work 😀 ). But that's for another time.

 

I agree with Pat.  Data tags are the way to go.  They are more flexible and faster than scripting will ever be.

 

If you're looking for a tool that will provide dimensions to 0,0 or any other base point, might I offer this:  https://www.verysmallgroup.com/dimension2

 

 

Link to comment

@Pat Stanford Thank you for the caveat.  While this is something weighing heavily on my mind, it seems I haven't given it enough thought.  Naively I thought this PIO would just drop a Truss Symbol that I could then copy/paste all over the place and use the snapping points to line up.  Benefit here also would be that I had someplace cleaner to store my symbols.  But I will take your advice and look into Data Tags

 

@michaelk Once again, Thank you MichaelK.  You helped me greatly in my adventures with worksheets and now this.  I will investigate the Data Tag option and report back with what I find.  In the meantime, thank you both.  Dimension2 looks wonderful.  I will also download that and incorporate it into my files.  Maybe find a way to tweak it a bit, aesthetically speaking of course.

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