Jump to content
Developer Wiki and Function Reference Links ×

VS:Include Files and Encryption


Thomas W

Recommended Posts

Hi all,

 

I'm writing a script and before cleaning it I reached the character limit that Vector's script editor accepts, so I'm testing the include files (even if after cleaning the script will be shorter (this is a method I wanted to test).

 

I looked at the examples that are here : https://developer.vectorworks.net/index.php/VS:Include_Files_and_Encryption#See_Also

And I have a few questions:

1- The unencrypted include files will be in .vss format and the encrypted ones will be in .px format, right?

2- Is it adding a .px extension to the include file that will encrypt the include file and the script?

(extract "Alternatively, include files can be encrypted along with the script which calls them by appending a .px extension to the name of the include file.")

 

On the https page above it has the example below:

 

in the include file myinclude.vss :

 

PROCEDURE Remote_Sub;

VAR

    j:INTEGER;

BEGIN

    AlrtDialog('This is the include function');

END;

 

and the calling script :

 

PROCEDURE EncryptExample1;

VAR

    i:INTEGER;

    s:STRING;

 

{$INCLUDE myinclude.vss}

 

BEGIN

    Remote_Sub;

END;

RUN(EncryptExample1);

 

3- I got it to work by specifying the exact path of type Y:\Thomas\VectorScript\TW VS Include script files with INCLUDE\myinclude.vss

Is it possible to make it work without specifying the exact path as in the example? Or is it always an absolute or relative path?

 

I tried by copying myinclude.vss to the default path shown in Script Options in the Script Editor:

C:\Users\t.wanner\AppData\Roaming\Nemetschek\Vectorworks\2023\FRA\Plug-ins\Marionette but without success.

 

If you have any advice on this, they would be welcome!

 

Have a great day

Link to comment

Ok sorry I found for question 3-:

 

It's specified in the VectorScriptGuide.pdf :  https://developer.vectorworks.net/images/7/72/VectorScriptGuide.pdf

 

Example: Windows-style include directive {$INCLUDE MyHD\Vectorworks\Projects\VS\mycode\math.vss} Include files specified without any path information are assumed to reside in a predefined default path relative to the script. For document scripts and scripts run from text files, the default path is the location of the Vectorworks application. For plug-ins, the default path is assumed to be the folder where the associated plug-in is located.

 

 

So putting the myinclude.vss file here; C:\Program Files\Vectorworks 2023 FR it works...with {$INCLUDE myinclude.vss} without specifying the exact path.

Edited by Thomas W
Link to comment

On Windows you can use Notepad++. Fresh installed you can use the Pascal Syntax highlighting, that sure helps a lot for the readability.

If you want VectorScript syntax highlighting and auto completion, you need to add a few files. Here's some more information but it seems all the download links are down... 😞

However, it seems my version can still be downloaded from Notepad++ itself: https://github.com/notepad-plus-plus/userDefinedLanguages/blob/master/UDLs/VectorScript_byMaarten.xml , I haven't checked if it still works though...

  • Like 1
Link to comment

@Martin DE Thank you for this information!

I downloaded your .xml version of the vectcorscript functions and copied it to C:\Program Files (x86)\Notepad++\autoCompletion and it works fine, it offers me the vectorscript functions that are available in your file. And the Pascal language defines for syntax highlighting also helps a lot.

I was just wondering if there are new vectorscript functions do you update it yourself manually or point to an original Vector file that contains all the functions?

 

@Martin DE and @Patrick Stanford

 

In any case, thank you for all this useful information and have a nice day!

Link to comment

I rarely write VS nowadays, and if I do I use the build-in VS editor of VW which I think works pretty good for the things I need to do. So I'll not update that file anymore, but feel free to do so!

BTW, I found the other file, it needs to be placed here: C:\Users\*yourUserName*\AppData\Roaming\notepad++ . This way you can use Vectorscript instead of Pascal. But be aware, this file is from 2014, so same as that other file, it's outdated, but feel free to add the new functions to it.

userDefineLang.xml

  • Like 1
Link to comment

Recently I moved to Notepad++ and have a full environment geared to Vectorscript but need to package and document. In the interim, find included an auto completion file for "Pascal" which is up to date for Vectorscript VW 2023. Place in the folder "notepad plus/autoCompletion" and set language to "Pascal".

 

I also used the "Style Configurator" to add "User-defined keywords" to "Pascal" for Vectorscript specific "INSTRUCTION WORD"s. Find attached "stylers.xml" which replaces file in folder "Notepad plus". Rename the old one first if you want to keep for reference. Valid Vectorscript file extensions are ".vss" or ".px"

 

Notepad implements plugins which add powerfull ways of improving the environment, particularly

PythonScript plugin

QuickText plugin

NppSnippets plugin

 

I wrote a python parser to get content from the Vectorscript Language Reference (HTML) which picked up procedure/function, parameters and description and was written to the autocomplete file. Needed a bit of prep work first though. In future, I will probably add new Vectorscript calls by hand.

 

Note, if you type a bracket after a valid VS call, you get a popup message for the call.

 

I have my own user defined language for Vectorscipt but I am having problems with the plugins and autocompletion not recognising the UDL so I use Pascal instead. Need to investigate further.

 

I tend to install the portable version of Notepad++ so I can put on a memory stick.

pascal.xml stylers.xml

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

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