Jump to content
Martin Crawford

Updating Plugin Pop-Up Choices

Recommended Posts

I have a set of scripts that all use an equipment model number to work. I would like to know if there is a way that I can have a script update the pop-up choices on all the scripts. This would would make adding new equipment faster, especially as I already have a script that creates the equipment.

 

Thanks

 

Martin

Share this post


Link to post

It would be possible to do this with a script, but would probably be slow and difficult to get right.

 

Since you are on a Mac, I would look at getting BBEdit and using the multi-file find and replace to do the changes that way. You will probably want to restructure your scripts to use {$INCLUDE filename} structure so that most/all of the script is stored in a plain text file rather than being stored only in the VW document.

 

If you do this you might be better off converting the scripts to Menu Item Plugin Objects so you only have to update them once rather than in every document. You will probably also need to turn on the program switch to compile the script on every run.

Share this post


Link to post

When I said scripts, I really meant custom plug-in objects. I would like to update all the plug-in with the same drop-down.

 

Does that change the approach?

Share this post


Link to post

Without seeing the code, it is hard to say.  If they are all similar and you want the same topdown list, you can probably edit each script to use a single include file that has just that portion of the code.

 

Then you would only need to edit that one include file and recompile each script.

 

If they are PIOs and are used multiple times in a drawing, you probably don't want to have the Alway Compile setting turned on, so you would need to open each in the Plugin Editor. I don't know of any want to automate that step.

 

@JBenghiat, @MullinRJ, @Sam Jones  Any of you have any suggestions?

Share this post


Link to post

If you’re just looking to modify parameter options, there’s not really a way to do this. 

 

If your script is event enabled, you can use the WidgetPrep event to fill menus based on code as opposed to the predefined list. In your case, you can read values from a file. If you’re not currently using event enabled scripts, you are opening a proverbial can of worms, but you can greatly expand your available functionality. I believe the archive has some posts to get you started. 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

 

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.

×