DCB Posted January 3 Share Posted January 3 Hello All, I'm in the process of refining (cleaning up) the names of resources in a template file. I'd like to generate a list of all the resources in the file for export to Excel. Ideally the list should have two columns: name of resource, type of resource (e.g., symbol, hatch, hardscape style, material). But just of list of the resource names would also be a good start. I don't have any programming skills/experience. I'm wondering if someone has developed a script that has this sort of functionality. Thanks, Dave Quote Link to comment
Pat Stanford Posted January 4 Share Posted January 4 Take a look at this thread about using Database By Script to generate a worksheet of Resources. The resources have a footnote in the Vectorscript appendix of (1). https://developer.vectorworks.net/index.php?title=VS:Function_Reference_Appendix_D Change the 16 [for a symbol definition] to whatever the object type is in Appendix D and your should be able to get different resource types. A formula of =N should provide you with the resource name in one column. A formula of =ObjectTypeName should provide you the type of object. Ask again if you need more help. 1 Quote Link to comment
DCB Posted January 6 Author Share Posted January 6 Thanks Pat! I'll check it out. Dave Quote Link to comment
DCB Posted January 7 Author Share Posted January 7 Hi Pat, I believe I have set-up your script and an associated worksheet correctly, however I'm wondering about the results (see the attached screenshot). The worksheet is listing all the objects in the specified design layer (not just the features with the record format specified in the script). I'm wondering if you might know why this is occurring. Also, is it possible to use this script to make a list of all the resources in a file (not just those that have been placed in design space or are in use)? This is the type of list that I'm hoping to generate. I'm auditing the names of resources (worksheets, line types, symbols, etc.) in a template file. I'd like to export a list of all the resources in the file and import the list into Excel where we can then make an organized list of proposed name changes. Thanks for your help. Dave Quote Link to comment
Pat Stanford Posted January 7 Share Posted January 7 Can you post a sample file. Likely to be much easier to troubleshoot if we are both looking at the same thing. Quote Link to comment
Jesse Cogswell Posted January 8 Share Posted January 8 Sorry for the delay, I've been on vacation the last couple of days and away from my computer. I wrote up a little script that might do what you are asking for. Running the attached command will open a dialog box showing all named objects within the active drawing (including "hidden" special records and objects used under the hood). You can select which ones you would like in a report (with a handy option to quickly highlight all matching object types) and which columns to include. When you press OK, you will be prompted to enter in a unique name for a worksheet. Once entered, a Worksheet will be created with all checked items and columns. You can also enter the name of an existing worksheet if you wish to overwrite it. Columns are sorted by Object Type by default, but you can sort by whatever you wish by clicking on a column header. Unfortunately, there's not a way to have a double sort (first by Object Type, then by Object Name). There is a hard maximum row count in worksheets of 32767, so you will be restricted to 32766 object names before you reach data loss (this really shouldn't be an issue. If you have 32767 unique names in a single drawing, you likely have bigger issues). This worksheet can then be exported to Excel for faster "Find" functions. If you aren't familiar with installing and using plug-ins, there are some instructions on this README page. For (slightly) easier installation, you could consider using my Free Manager tool that will handle the installation of the plug-in and can be used to keep everything up to date (and has lots of other free plug-ins): The Object Type names are coded into plug-in strings for easy localization, but not all object types are included in the appendix, so I've invariably missed some. If you run the command and the Object Type column is empty, let me know what the resource type is and I will get it updated. If you would like to know more about the underlying code and how it works, please let me know and I will be happy to share it. Create Named Object Report.vsm 1 2 Quote Link to comment
setdesigner Posted January 8 Share Posted January 8 This is great ! Thanks. Both the Free manager tool and the create named object are very helpful ! 1 Quote Link to comment
DCB Posted January 8 Author Share Posted January 8 Hi Pat, Sample file is attached. These are my questions: #1 - Why is the worksheet is listing objects that aren't symbols and objects that don't have the record format referenced in the script (Materials - Bulk)? #2 - It looks like the behavior of the worksheet is to only allow editing of record fields that are in the record format inserted into the script, is this correct? And the big question: Is it possible to develop a list of the resources in the file put not necessarily placed in design space? Thanks Pat. Where would we all be without your help! Test_SymbolDefinitionScript_ForStanford_2025-01-08.vwx Dave Quote Link to comment
DCB Posted January 9 Author Share Posted January 9 (edited) Jesse, your Named Object script is fantastic. Very, very helpful. It's exactly what I need. Dave Jesse - Follow-up question. Do you have a readme document or other resource that provides an overview of functionality for the tools listed in the JNC Tools Manager? Edited January 9 by DCB Quote Link to comment
Jesse Cogswell Posted January 10 Share Posted January 10 @DCB I've been writing readme documents for the tools when I get time. It's not an awful process, but can be a time consuming one, so I have them for only a handful of the tools. In the manager, if you click on a tool that currently has one completed, the View Readme button will be enabled and clicking on it will open the readme in your default browser. If there are any you have questions about, 90% of them were written and posted on this forum, so searching the name of the tools may turn up the original posts (search these in Google my including the name of the tool and "Vectorworks forums" in the search, don't bother trying to search directly in the forum search bar, you likely won't find what you are looking for). Otherwise, feel free to reach out in a DM if you have any questions and I will do my best to get back to you when I am able. 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.