Jump to content
Julian Carr

Messages and Includes

Recommended Posts

We are using a lot of saved views in our training and have added a script to each saved view to open the message window with some instructions that pertain to each particular step. This allows users to be able to work in the file while still having the instructions visible and unaffected by view changes, panning or zooming. The notes for each of the message strings come from a worksheet within the file. There are two things that would make this process better.


1. Being able to get the name of the current saved view that is running the script.

2. Being able to access the script via an include file.


Can anyone think of a way to do either of these things? Because we run training courses at a 3rd party training venue, we generally can only install the training files in a folder on the Desktop of each machine, so the potential path to any include file will be different on each machine.


Thanks for any ideas.




PS. I discovered that you can get around the limitation of 256 characters in a message, by concatenating a series of sub 256 character strings together within the message call.

Share this post

Link to post

For point 2: have you tried relative paths for the includes?


If you copy always the same folder onto each computer, then the relative paths should still always be the same, shouldn't they?


(Sorry, I cannot help for point 1)

Share this post

Link to post

I do know any, but it is not difficult, as the $INCLUDE notation does not change. You must just specify a relative path, instead of an absolute one.


E.g., instead of using:

{$INCLUDE c:\some\path\where\I\am\scripts\myscript.vss}


just use:

{$INCLUDE scripts\myscript.vss}

Edited by Nicolas Goutte

Share this post

Link to post

Thanks again Nicolas. Unfortunately I can't get it to work. A full path such as this will work:


    {$INCLUDE /Users/juliancarr3/Desktop/MessageScriptTesting/MessageScript.vss }


but then something like this (or variations thereof), does not work:


    {$INCLUDE /MessageScriptTesting/MessageScript.vss }


The Vectorworks file with the saved views is also in the MessageScriptTesting folder.


The following also doesn't work on the Mac which is unusual because I normally use backslashes in include names:


    {$INCLUDE \Users\juliancarr3\Desktop\MessageScriptTesting\MessageScript.vss }

Share this post

Link to post

Your path should not start with / . A path starting with / means that it is absolute (The same with \ under Windows)


As for your last example, I do not know if the space is allowed before } or if the space would count as if being part of the path.

Edited by Nicolas Goutte

Share this post

Link to post

Thanks Nicolas. Yes I tried a few different combinations including this:


{$INCLUDE MessageScriptTesting/MessageScript.vss}


but none of them worked.

Share this post

Link to post

Do you not require a single period or double period before the slash.

Single period representing the current directory and double period meaning go up one directory level.

Also is the mac platform freed from activating Unix escape sequences (like \n ) when utilizing back slashes? You might need \\ to break the escape sequence.

I'm no guru when it comes to Unix but I just read about this potentially being a problem when scripting.

Of course one cannot span drives when using relative paths; only the active drive is accessible.

Share this post

Link to post

A bit late but why don't you create a folder in the root directory to access. This should be the same path for every PC/user.

Share this post

Link to post
On 7/30/2018 at 11:42 AM, Julian Carr said:

Thanks for the suggestion Nicolas. Do you know if there is any documentation on how to create relative paths?


Julian, is this what you are looking for?


{$INCLUDE ..\BlaBla.vss}

--> go up 1 folder from current file location (= file containing the running script)


{$INCLUDE ..\..\BlaBla.vss}

--> go up 2 folders from current file location


{$INCLUDE ..\..\MyFolder\BlaBla.vss}

--> go up 2 folders and enter MyFolder from current file location


Edit: this is platform independent.

Edited by orso b. schmid
removed extra character

Share this post

Link to post

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.

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.


7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114


© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

  • Create New...