Sam Jones Posted November 3, 2023 Share Posted November 3, 2023 Using vectorscript, how do I import a linestyle contained in the shipping Vectorworks libraries, say "ISO-02 Dashed"? Expanding, how do I access Vectorworks libraries of all kinds in VS? Bite off as much as you have energy for. As always, TIA. Sam Quote Link to comment
Pat Stanford Posted November 3, 2023 Share Posted November 3, 2023 The same way as you get other resources with one of the BuildResourceList calls. The Object Type for a Line Type is 96. The following folder indexes return one or more Line Types. 2, 3, 7, 8, 15, 20, 23, 25, 26, 27, 29, 108, 110, 111, 115, 120, 125, 133, 142, 159, 161, 164, 167, 169, 174, 189, 190, 198, 202, 218, 219, 221, 223, 227, 228, 230, 242, 247, I leave it to the reader to determine which folder index is best for your needs. I have no idea WHAT folder the ones that are not in the list in the BuildResourceList documentation are. Below is the script I used to generate the list of folders. I only put the CreateText in so I could copy the list to put in this post. If you run the script you will get an AlrtDialog that shows you the name of the first Line Type in the folder. PROCEDURE Test; CONST ObjectType = 96; { LineTypes } FolderIndex = 100; { BuildResourceList Def for Application Folder See Func. Ref } SubFolderName = ''; { Nul subfolder get all folders and subfolders } VAR MyName : STRING; MyList : LONGINT; NumItems : LONGINT; hatch : HANDLE; FIndex : Integer; S1 :String; BEGIN S1:=''; For FIndex := 1 to 255 DO Begin MyList := BuildResourceList(ObjectType, FIndex, '', NumItems); MyName := GetNameFromResourceList(MyList, 1); { change this number to get the names of other textures } If NumItems>0 then BEGIN AlrtDialog(Concat( Date(2, 2), ' ',FIndex,' : The Name is ', MyName, ' *** Total items in list: ', NumItems)); S1:=Concat(S1,FIndex,', '); End; End; Message(S1); hatch := GetResourceFromList(MyList, 1); IF (hatch = NIL) THEN hatch := ImportResourceToCurrentFile(MyList, 1); DeleteResourceFromList(MyList, 1); CreateText(S1); END; RUN(Test); Quote Link to comment
Pat Stanford Posted November 3, 2023 Share Posted November 3, 2023 Update: The Build Resource folder list on the Dev site version of the Function Reference is much more complete that the one in the HTML version of the function reference. 174 is the folder index for the Attributes - Line Types resources. 1 Quote Link to comment
Recommended Posts
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.