Jump to content
Developer Wiki and Function Reference Links ×

Can I 'save' Vectorscripts that I create in a single file to the Resource Manager?


Recommended Posts

You can save your master file as a template (.sta) and when you open new files using that template your scripts will be included. Use menu File > Save As Template...

 

OR

 

You can create Menu Command plug-ins from your scripts with the Plug-in Manager (Shift-Cmd-Z), which are subsequently added to the VW interface with the Workspace Editor (Option-Shift-Cmd-W). Hot keys can be assigned to your scripts in the Workspace editor so you can quickly access them, too. This is the more tedious route, but the more flexible one

 

If you need help with either of these options, please write back.

 

Raymond

Edited by MullinRJ
Link to comment
1 minute ago, MullinRJ said:

You can save your master file as a template (.sta) and when you open new files using that template your scripts will be included. Use menu File > Save As Template...

 

OR

 

You can create Menu Command plug-ins from your scripts with the Plug-in Manager (Shift-Cmd-Z), which are subsequently added to the VW interface with the Workspace Editor (Option-Shift-Cmd-W). Hot keys can be assigned tour scripts in the Workspace editor so you can quickly access them, too. This is the more tedious route, but the more flexible one

 

If you need help with either of these options, please write back.

 

Raymond

 

Thanks Raymond. As I normally 'inherit' my files from other users, I think the your second suggestion may be better for me.  How would I start by going this route?

Link to comment

@Chris Burton,

 

1) Check out this link and read what Robert Anderson wrote several years ago. I think most of it is still relevant.

 

2) Open the Plug-In Manager and create a new plug-in – type Command, it's the top choice. Give it a name, and click Enter.

 

3) Next, click the Edit Script... button and paste your script code here. Select Vectorscript or Python and click OK.

 

4) Next, click the Edit Definition... button and select the Properties tab. Here you and add a Tool Tip to describe your command when you hover over it with the cursor, and set any restriction on how it executes. Mostly, NONE is acceptable, unless something needs to be selected.

 

5) Click OK, then click Close.

 

6) Wash – Rinse – Repeat for each script you want to immortalize.

 

Are you familiar with the Workspace Editor? If not, write back if you need help to add your new commands to a menu.

 

 

Raymond

 

Link to comment

Make a standard Vectorworks file with your scripts in it.

Select it in the Resource Manage and choose Add Selected File to Favorites from the gear icon.

 

image.png.0767b73db63681ab95f938ec6fb5d51d.png

 

This file with your scripts will now show in the Favorites section of the left hand column of the Resource Manager. 

 

When you need a script in a file, open the RM, select the Favorite File and then right click on the Script(s) or Script Folders that you need and choose Import.

 

image.png.946eb54803b9de5344b6a245eb3a77b3.png

Link to comment
  • 3 months later...

Hey @Pat Stanford, can I piggyback on this conversation? My question is similar.

 

I am creating a .sta file for my team and  it should also include scripts as menu commands (called by shortcuts )

 

whats the most convenient way pass the script on? 
 

the .sat file and special workspace are distributed via the workgroup folder

Link to comment

It sounds like you have actually made Plug-in Menu Commands out of your scripts. That means that there is no longer any link between that and a specific file, not even a stationary (.sta) file.

 

You will need to transfer the Plug-in to each user who needs it and either transfer the workspace they have been added to or instruct them on how to edit their workspace to add the commands.

 

On Mac the custom menu commands are stored at:  image.png.f327dce069c9e1f333f00fa7ce3f638f.png

Workspaces are at: image.png.8d4da0c8a6c5d8beeabef99cd75461c5.png

Path on Windows is similar but I don't know it off the top of my head.

 

The Menu commands should have a file extension of .vsm

Plug-in Objects are .vso

Plug-in Tools are .vst

 

It actually looks like you could also store the files in a similar path in a Workgroup folder so as long as you put the workgroup somewhere that they can always access it (i.e. on a synced dropbox location if you have people who will be using a laptop away from the office) then you should only need a single copy of the files in the workgroup.

 

I seem to remember that Workspaces in the Workgroup could be challenging as a user could end up editing the workspace and changing it for everyone.

 

HTH

 

Link to comment

Hey @Pat Stanford thanks. Alright I‘m gonna try that folder path inside the workgroup folder, it makes sense. Our folders are indeed synced inside the company network.

The only thing I‘m not sure is if the workspace will find the connection to the script, but let’s see.

 

Would you have a different approach in mind to do this?


 

Actually my experience with workspaces in workgroups was that if someone would edit the shared workspace it would immediately be copied into the user folder and edited from there, so the workgroup workspace stays untouched.

Link to comment

Workspaces find plug-ins by name, not by path, so that should not be a problem.

 

One thing to watch out for is that the priority order is User Folder > Workgroup Folder(s) > Application Folder. So if someone copies the Plug-in Menu Command from the Workgroup to their User Folder they will not see future modification to the command unless they copy it over again.

 

I am pretty much a solo so my experience with Workgroup Folders is limited. Nice to hear that they work OK.

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