Jump to content
  • 0

Script palette not updating after import/export

Ross McLee



I have created a number of very simple custom selection scripts to help me edit devices within a ConnectCAD schematic in bulk based on the selection criteria (thanks @Pat Stanford for staring me on that path!)


I wanted to use the same scripts in another existing project so I exported them from one file to the other using the export function within resource manager.

I store my scripts in a resource folder called "My Palette". After the export, the scripts didn't appear in My Palette on my desktop. Closing and reopening the file the palette was refreshed as needed. Have I missed a step in the export process? i there a refresh palettes 'button I didn't press?... or is this a small bug?


Attached are two screen shots showing the contents of the palette on my desktop and within resource manager next to it, they were out of sync then in sync 'after' reopening the file.


Feedback always appreciated,


2021-04-08 (after).png

2021-04-08 (before).png

Link to comment

7 answers to this question

Recommended Posts

  • 0

You probably don't want to Export the scripts, rather just store a VW file with the scripts somewhere and make it a Favorite. You can then access that Favorite file from the file you want the scripts in and Import.


At least that is the way I do it.  ;-)


When I think about the Export function, it is mainly to put a newly created resource into a "library" file somewhere. I don't think it works the way you are trying to use it as Resources are loaded when the file is opened. Since you are Exporting into a file that is already open it does not surprise me that you have to close it and reopen it.


"Try the Import. It is really good today. And it pairs well with the house Chianti."

  • Like 1
Link to comment
  • 0

Didn't realize you were working in a Workgroup environment.


In that case you might want to use Export.  Set up a Scripts File in the workgroup folder. When you edit scripts Export them into the shared file. Team members can then go to the shared file and import the scripts from there when they need them.


What this won't get you (and I don't think it can be reasonably done in VW) is to update the script in every file it has been imported into. Once the script has been imported, the version you have in the working file is the version you have.


Actually one work around might be to put an "expiration date" into each script. If the script is past the expiration date then don't run and throw up a message to delete and import a new version.


Or maybe a "Bill of Lading" check. Put a file (text/xml) containing the current version of all the scripts somewhere accessible. When the script runs it should check and see if it is the current version or not.


Both will be "interesting" to implement properly and when you update a script and suddenly the user is interrupted and not able to run the script they want without downloading the new version you are likely to end up not very popular.


Let's keep discussing options.

Link to comment
  • 0

So, coming from an AutoCAD background where I used to create all my 2D schematics and layout drawing for AV systems (now using ConnectCAD for that). I was used to having a ToolPalette which we, as a team, shared. It was always there regardless of which file was opened. I would create block definitions of various objects (all 2D but with visibility states of top, side and front elevations if needed) in a single library file. The team would just click and insert the symbols. If I edited the tool palette with more symbols they would see them the next time they started ACAD. The limitation was that I had to be careful as the last one exiting ACAD would be the last to save to the XML index file it was based on. So updates to the tool palette were coordinated at the end of the day so I would be the last one to exit and save.


I'd like to be able to have a "tool palette" for the team that has all my handy scripts in it (and as others become familiar with scripting their's too). Available regardless of which file is open. Without the need for importing into the current file or opening a separate folder manually.


At the moment with the current file I have open "My Palette" appears on my desktop as a handy tool bar. I have saved the same scripts folder to our template file so any new files will get the same. But that will become out of date instantly if I come up with a new script in this current project file and forget to export it to the template file.


May be I'm doing this completely the wrong way ?...



Link to comment
  • 0

Unfortunately you are not doing it the wrong way.  Scripts are local to a file and are only able to access VW items in that file. No way to use a script to create a new file or move an object from one file to another. No way to use a script except to import it into the file.


If you were on Mac I would suggest using AppleScript to fire the scripts as this could be cross file.  I have heard rumblings (for a long time) that there is a way to do this on Windows, but I have never seen anyone actually doing it or give a good enough description of what that method would be to wrap my head around it.


If you are willing to work in Python, you might be able to use something like the following thread to read in a script and execute it. Then you would have to keep your scripts as text files somewhere generally accessible. This would (possibly) solve the problem of distrbuting updates to scripts, but it would not solve the problem of initial distribution of new scripts.  Look closely at the last 3 or so posts.




Link to comment
  • 0
On 4/8/2021 at 10:56 PM, Ross McLee said:

have created a number of very simple custom selection scripts to help me

We did exactly this too and for a long time we had them on script palettes which were in all template files.This worked fine however the scripts were used so much that we decided to create new menus for them and add them to our office workspace.


Now the scripts are available to everyone all the time and no random palettes floating around.


The plug-in manager is used to do this in conjunction with the workspace editor.

Plug-ins work fine from a workgroup location.

Workspaces we have found are better copied and pasted into each local user library.

  • Like 1
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.

Answer this question...

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