Jump to content
Developer Wiki and Function Reference Links ×

run another script within a script


Recommended Posts

For Python you are creating a standard import file or module, and the rules are a little different. I think the python form includes some relevant posts.

 

For VS, create a vile with the extension .vs, .vss, or .px. px files will include and encrypt themselves for locked plug-ins. They also work for unencrypted plug-ins, so that's what I tend to use.

 

The syntax is {$INCLUDE filename.extension}. You can see more in the Vectorscript Language Guide: https://developer.vectorworks.net/images/7/72/VectorScriptGuide.pdf

 

If no path is provided, Vectorworks will look for a file in the same directory as the calling script, which if called from a plug-in, will be in the plug-ins folder.

 

You can also include an absolute path or a valid POSIX path (including relative paths) to access the include file anywhere on your system.

  • Like 1
Link to comment
  • 3 weeks later...
On 1/6/2023 at 6:47 AM, JBenghiat said:

If no path is provided, Vectorworks will look for a file in the same directory as the calling script, which if called from a plug-in, will be in the plug-ins folder.

 

You can also include an absolute path or a valid POSIX path (including relative paths) to access the include file anywhere on your system.

Is there a way to use relative / posix paths to include files one folder down? I am attempting to organise a fairly involved plugin that ideally references files in a hierarchical structure e.g.:

  • plugin.vso
  • modules/
    • module1.px
    • module2.px
    • models/
      • model1script.px
      • model2script.px

I can easily import files in the same same level as the plugin folder but attempting to include any files further down don't seem to be recognised.

My best guess is that this is a quirk of the version of pascal VectorScript is but unfortunately I can't move to python.

 

Thanks

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