Martin Crawford Posted November 1, 2018 Share Posted November 1, 2018 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 Quote Link to comment
Pat Stanford Posted November 2, 2018 Share Posted November 2, 2018 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. Quote Link to comment
Martin Crawford Posted November 2, 2018 Author Share Posted November 2, 2018 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? Quote Link to comment
Pat Stanford Posted November 2, 2018 Share Posted November 2, 2018 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? Quote Link to comment
JBenghiat Posted November 7, 2018 Share Posted November 7, 2018 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. Quote Link to comment
Recommended Posts
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.