Jump to content
Developer Wiki and Function Reference Links ×

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.

 

Julian

 

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.

Link to comment

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
Link to comment

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 }

Link to comment
  • 4 weeks later...

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.

Link to comment
  • 1 month later...
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 _c_
removed extra character
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...