Jump to content
Developer Wiki and Function Reference Links ×

Symbol path via Vectorscript


twk

Recommended Posts

Greetings All,

1. Have created a VW file that contains all the objects we usually draw with, stored as symbols (beams/roof cappings/architrave mouldings/etc).

2. Each building element type is a folder that has different items in them (ridge/hip roof caps are in the roof cappings folder,etc).

3. Is there a way to determine via vectorscript the path of a symbol(its location, whether in a folder and what folder its in)?

4. I would like to create a dialog box that populates the external files symbols, with symbol folder locations for easier identification.

I've build the external files resource list via VS:BuildResourceListN , and also get string values for the symbol names.

Is there an easier way to create a string of the symbols path location, eg.

SymPath(SymbName:STRING;VAR SymPathStr);
Begin

End;
SymPath('20degRoofCap',SymPathStr);

And SymPathStr would return 'Roof Cappings\20DegRoofCap'.

I had a look at hippothamus' code on the forum here script to switch symbol from dialog,

where he was trying to replicate the Replace Symbol popup dialog.

However he had to parse through handles to symbolfolders etc, in the current file. Im not sure how this would work with external files.

Is this the route to take to get symbol's folder's names? or is there an easier method?

Here's to hope :)

Thanks in advance

Tui

Link to comment

Hi,

This is something a lot of users have requested in the past but sadly the buildresourcelist only gives you the names of these symbols if coming from an external resource. This means that you can only add them to one Listbrowserfolder if you want to create something like the example you mentioned.

I'm soon going to launch a website with some tools and functions. One will be a vectorscript function to create a simple ChooseSymbolDialog without the need of all the knownledge and code. The example I posted doesn't work perfectly but this one will, it's created with the sdk instead.

I do know of a workaround for you by creating a dynamic array of resourcelists.

What you can do is start in a certain folder and use the appropriate functions to list all folders and subfolders. If you'd create a resource list for each folder you can separate them by filename. Some coding to do there... :)

Link to comment

Not sure I have quite grasped the complete scope here but isn't this something that could be accomplished by passing two vectorscripts to Vectorworks via (on Mac platform) Applescript and the DoScript command?

First vectorscript passed would Open the source file, parse the data, save said list to an external data file, close source. Second would open destination file, read in saved data, then save and close destination file and delete external data file.

Link to comment

Thanks Hippothamu, your insight is much appreciated. I did see the GetParent Function, and will try and implement that into getting the directory structure of the symbols.

(Thinking to loop Getparent until theres none, and write each getparent to string to find the folder names. Havent tried it yet but thinking that 'may' be an easier route. Will post back my findings)

Hi LarryO, Thanks for your input as well, I'm actually on the Windows OS platform, and have no experience in MacOS's let alone Applescript/Doscript etc.

Thanks all.

Link to comment
the buildresourcelist only gives you the names of these symbols if coming from an external resource.

Actually, feeding BuildResourceList a folder index of "0" will build a list of resources in just the current document. A negative index will build a list from just an external folder. A positive index will build a list based on both the current document and an external folder.

Link to comment
the buildresourcelist only gives you the names of these symbols if coming from an external resource.

Actually, feeding BuildResourceList a folder index of "0" will build a list of resources in just the current document. A negative index will build a list from just an external folder. A positive index will build a list based on both the current document and an external folder.

What I ment is that you can only retrieve the name of these resources IF they come from external files. There is no way to retrieve the filename or the symbol folder. When the resource is from the active file you can get the symbol folder.

Link to comment
  • 5 years later...
On 2/24/2015 at 8:45 AM, Hippocode said:

What I ment is that you can only retrieve the name of these resources IF they come from external files. There is no way to retrieve the filename or the symbol folder. When the resource is from the active file you can get the symbol folder.

HI,

is this still the case or is it possible in the meanwhile?

 

 

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