Sam Jones 179 Posted April 2 It is possible to import resources from a file into the current file. There are a variety of ways to do this with BuildResourcList() and ImportResourceToCurrentFile() and CopySymbol(). All of these require that the script maker know the file name or folder name containing the resource. Is it possible to present the user with a Finder brower or Director trouser similar to the one presented with the PutFile() command? I would like to present the user with a way to find a file or folder from which to import resources. Possible ?? Quote Share this post Link to post
JBenghiat 371 Posted April 2 See https://developer.vectorworks.net/index.php/VS:BuildResourceListN and https://developer.vectorworks.net/index.php/VS:BuildResourceListN2 Quote Share this post Link to post
Sam Jones 179 Posted April 2 I don't see how these help. They don't let the user look around their hard disk for the file they want to get resources from. With "PutFile", the user can look around their hard disk for the text file they desire. Perhaps, you have nifty little algorithm that simulates this functionality for finding .vwx files????? Quote Share this post Link to post
JBenghiat 371 Posted April 2 You almost answered your own question. https://developer.vectorworks.net/index.php/VS:GetFileN Quote Share this post Link to post
Sam Jones 179 Posted April 2 Unfortunately, I cannot get that to work. This code from the developer wiki fails to allow the selection of a .vwx file. PROCEDURE Example; VAR fileName, title :STRING; defaultFolder :STRING; mask :STRING; BEGIN title := 'Select the object library file...'; defaultFolder := ''; mask := '*.vwx'; fileName := 'Drafting Tools.vwx'; IF GetFileN(title, defaultFolder, mask, fileName) THEN AlrtDialog(fileName); END; RUN(Example); Quote Share this post Link to post
Jesse Cogswell 71 Posted April 3 Unfortunately, I don't think Vectorscript has any commands dealing with files outside of text files for logs or resources. I think you might need to use Python's ability to deal with files using PythonBeginContext and PythonExecute to pull Python coding into Vectorscripts. As a disclaimer, I have not yet tried this, but I suspect it's very possible. Quote Share this post Link to post