RBergman Posted July 20, 2022 Share Posted July 20, 2022 (edited) I'm learning Vectorworks and having fun working out how to make use of what it has to offer. I'm currently working on a materials take-off for a irrigation design and I can't help but think that I can speed up the process by adding record formats and extracting that into a worksheet that'll do the counting for me. I'd like to create pieces of abbreviated text that name a various parts or fittings, then place that text in the drawing near where that part or fitting would actually be in the layout of the design. This way, the list of parts needed to build the actual irrigation system could be visually cross referenced with the drawing of the design to see where the fittings are supposed go. All while saving a huge amount of time by being able to create a report of all the parts straight out of the drawing, rather than scrutinizing the drawing and writing it all down, all the while hoping I'm not skipping anything. Can I attach data (record format?) to a piece of text? If so, how do I go about doing it?? Thanks! Edited July 20, 2022 by RBergman Quote Link to comment
Pat Stanford Posted July 20, 2022 Share Posted July 20, 2022 Two possibilities. 1. Take a look at Data Tags. You can make a tag that allows manual entry of text. You can format them to look however you want. 2. Custom Records and Link Text to Symbol. Create a custom record with the field your need in the Resource Manager. Make a Symbol. If you don't want any shape it could just be a locus point. Attach the Record to the Symbol in the Data pane of the OIP. Put a piece of text near a placed instance of the symbol. The text is just a placeholder. Select the Symbol and the Text. Modify:Link Text To Record. You will get a dialog box asking what Record/Field to use. Repeat the above steps to add additional "fields" You can now edit the field data in the Data pane of the OIP and the text displayed I the drawing will change. Both of these are overly simplified, so ask again if you need more help. Quote Link to comment
adamscott Posted March 16, 2023 Share Posted March 16, 2023 On 7/20/2022 at 8:17 AM, RBergman said: I'm learning Vectorworks and having fun working out how to make use of what it has to offer. I'm currently working on a materials take-off for a irrigation design and I can't help but think that I can speed up the process by adding record formats and extracting that into a worksheet that'll do the counting for me. I'd like to create pieces of abbreviated text that name a various parts or fittings, then place that text in the drawing near where that part or fitting would actually be in the layout of the design. This way, the list of parts needed to build the actual irrigation system could be visually cross referenced with the drawing of the design to see where the fittings are supposed go. All while saving a huge amount of time by being able to create a report of all the parts straight out of the drawing, rather than scrutinizing the drawing and writing it all down, all the while hoping I'm not skipping anything. Can I attach data (record format?) to a piece of text? If so, how do I go about doing it?? Thanks! Same problem here, over the years I made symbol libraries with all in all about 3000 symbols. Opening each symbol by right click and editing a default value of a record format manually takes about 20 clicks and about half a minute if you are quick with this. Editing 3000 Symbols will take at least 3 - 4 complete workdays if you concetrate on doing only this, and you will get crazy from this work.... Quote Link to comment
Pat Stanford Posted March 16, 2023 Share Posted March 16, 2023 You should be able to set up a worksheet so that you can see and edit all of the record values. It should take less time than editing each symbol manually. But I guess it will depend on how you know what values you want to change. If you have to look up all 3000 items to get the values, then yes it will take a long time. 1 Quote Link to comment
Tom W. Posted March 16, 2023 Share Posted March 16, 2023 3 minutes ago, Pat Stanford said: You should be able to set up a worksheet so that you can see and edit all of the record values. Only if they're symbol instances right? I assumed @adamscott was talking about editing the default values for symbol definitions... Quote Link to comment
Pat Stanford Posted March 16, 2023 Share Posted March 16, 2023 @Tom W. You are right, you are wrong, and we have been lying to you and ourselves for the last 4 or 5 years. 😉 You are correct that by default, a worksheet can not display resources, so the simple version of what I mentioned about won't work. However a few versions ago (maybe 2018??) a new worksheet capability named DatabaseByScript was added. As the name implies, you write a script that will specify what items to show in each database subrow. They don't all have to be the same as they do when you are specifying criteria. It was originally added to allow reporting of subtotals above a database of plants. Unfortunately, they don't let you do some of the best database functions like sort or summarize items. The script has to do that. Here is a simple DatabaseByScript script that will return a subrow for each Symbol Definition with a record specified in the formula attached. Copy the script below into a new blank script named "SymDefsWRecord" Use it by right clicking on a row and choosing Edit Database Formula and entering a formula of: =DatabaseByScript('SymDefsWRecord','Record Name Goes Here') Put your record name in the formula as the second part of the formula. For column A, enter a formula of =N This will give you the Symbol Definition Name of the subrow. For column B enter a formula of ='YourRecordName'.'YourFieldName' using your actual record and field names. Add other columns as appropriate. You will now have a database showing the symbol definition and the value of the specified field. If you click into column B and the subrow and type in a new value and hit enter the typed value will be stored into the field for that symbol definition. I believe the order will be the order the symbols were created in, but I am not certain. The script could be modified to sort the data, but would end up about twice as long. HTH Procedure SymDefsWRecord; {©2023 Pat Stanford - pat@coviana.com} {licensed under the Boost Software License 1.0} {https://github.com/boostorg/boost/blob/master/LICENSE_1_0.txt} {TL/DR Use as you want, attribution for source, No warranty} {This script when used in a Vectorworks Worksheet DatabaseByScript Command} {will return a worksheet database listing every Symbol Definition that} {has the record that is defined in the first passed parameter attached} {You can then use standard worksheet functions to display the Record} {data. A formula of =N in a column will give the symbol name.} {To use, right click on a database row and choose Edit Database Formula.} {In the formula bar make a formla OF} {=DatabaseByScript('SymDefsWRecord','Record Name Goes Here')} {Very lightly tested. Test for your use. Here be Dragons.} Var H1: Handle; N1,N2: Integer; ListID,ListLength,L3:LongInt; S1: String; Begin S1:=WSScript_GetPrmStr(0); ListID:=BuildResourceList(16,0,'',ListLength); For L3:=1 to ListLength do Begin H1:=GetResourceFromList(ListID,L3); N1:=NumRecords(H1); For N2:=1 to N1 do If GetName(GetRecord(H1,N2))=S1 Then Begin WSScript_AddHandle(H1); End; End; End; Run(SymDefsWRecord); 2 2 Quote Link to comment
Tom W. Posted March 16, 2023 Share Posted March 16, 2023 Pat this sounds amazing thanks so much for sharing + the really clear instructions. I will try it out as soon as I get a moment! I'd long consigned myself to doing it all manually, symbol by symbol, I had no idea such magic was possible 🙂 Thank you Quote Link to comment
Tom W. Posted March 17, 2023 Share Posted March 17, 2023 @adamscott Pat's script works great I highly recommend it! Incredibly useful to have. Thanks again @Pat Stanford 1 Quote Link to comment
adamscott Posted April 24, 2023 Share Posted April 24, 2023 On 3/16/2023 at 10:46 AM, adamscott said: Same problem here, over the years I made symbol libraries with all in all about 3000 symbols. Opening each symbol by right click and editing a default value of a record format manually takes about 20 clicks and about half a minute if you are quick with this. Editing 3000 Symbols will take at least 3 - 4 complete workdays if you concetrate on doing only this, and you will get crazy from this work.... thanks a lot for help! Quote Link to comment
KAKI Posted February 20 Share Posted February 20 Hello, I am new to Vectorworks scripting. I've followed the instructions but the database still appears as blank. Can you help me see what's the issue? Thanks! @Pat Stanford Quote Link to comment
Pat Stanford Posted February 20 Share Posted February 20 Use just Database not DatabaseByScript. Database takes critiera (like your record.field) DatabaseByScript requires a relatively complicated script to specifically identify every object in the database in the correct order. Quote Link to comment
KAKI Posted February 23 Share Posted February 23 On 2/20/2024 at 4:50 PM, Pat Stanford said: Use just Database not DatabaseByScript. Database takes critiera (like your record.field) DatabaseByScript requires a relatively complicated script to specifically identify every object in the database in the correct order. Hello, I've tried it and it's still empty. What I am trying to achieve is the same as the OP, link the Symbol definition records to the records of existing symbol instances. I've also followed the instructions by installing the script. But somehow nothing is showing up still. Do you have anymore tips? Quote Link to comment
Tom W. Posted February 23 Share Posted February 23 On 2/20/2024 at 11:53 AM, KAKI said: Hello, I am new to Vectorworks scripting. I've followed the instructions but the database still appears as blank. Can you help me see what's the issue? Thanks! @Pat Stanford Try using a comma (,) instead of a full stop (.) in the formula: See how it's written in Pat's script: Depending on where you are in the world you might need to use a semi-colon (;) instead of the comma. Quote Link to comment
Pat Stanford Posted February 23 Share Posted February 23 You are trying to use the Database criteria in the worksheet cell instead of in the database header. Right click on the Row header (I usually start at Row 3 because it is easier to add extra lines above later when I figure out what titles I need). Choose Database from the popup menu. This will open the Criteria Builder When you click OK on the criteria builder, the Database function will be automatically created. To edit later, right click on the database row header and choose Edit Criteria. Or if you want to manually adjust the criteria choose the Edit Database Formula and the database formula will appear in the formula edit bar so you can change it. Sorry that I didn't pick up on your putting the database in the wrong place on your first post. 1 Quote Link to comment
SedlmeierGuenther Posted Sunday at 11:21 AM Share Posted Sunday at 11:21 AM Hello Pat, I did everything as stated, but no objects (that are only in the accessories) are displayed for me. What am I doing wrong? Sedlmeier Günther Quote Link to comment
Tom W. Posted Sunday at 07:21 PM Share Posted Sunday at 07:21 PM 7 hours ago, SedlmeierGuenther said: What am I doing wrong? As per earlier post I believe you need to replace the full stop in the formula with a comma: In your case it may be a semi-colon instead of a comma i.e. =DATENBANK('SymDefsWRecord'; 'interiorcad sales info') Quote Link to comment
SedlmeierGuenther Posted yesterday at 04:33 AM Share Posted yesterday at 04:33 AM Hello Tom W. I have already tried comma, this converts VW to point. A semicola produces an error message (see screenshot) (a bracket is missing that is not missing). The same with a space. I think it's not because of the separator. I'm a bit at a loss. Greetings Günther Sedlmeier Quote Link to comment
Tom W. Posted yesterday at 05:41 AM Share Posted yesterday at 05:41 AM 58 minutes ago, SedlmeierGuenther said: A semicola produces an error message (see screenshot) (a bracket is missing that is not missing). I get the same message if I use a semi colon. Have you tried testing it with a comma but using different object/record + see if that works? @Pat Stanford will know better but I think it is designed to only work on symbol definitions + so the issue may be that you're using Interiorcad records... Quote Link to comment
Pat Stanford Posted 20 hours ago Share Posted 20 hours ago @SedlmeierGuenther Your are trying to use the DATABANK (Database) function in a cell in the worksheet. It does not work there. DATABASE and DATABASEBYSCRIPT will ONLY work where set from the right click menu on the row header. That is what converts the row into a database row. Re-read the thread, especially my post from February 23. That should get you the information you need. If that is not enough, then post a simplified example file here and we will try and make it work for you. Quote Link to comment
SedlmeierGuenther Posted 18 hours ago Share Posted 18 hours ago Thanks Pat for your answer, I set the formula via the line heading by right-clicking. Unfortunately, it is not. Can you please take a look at this. I am attaching an example file in which the symbols (in the accessories manager) have a database reference to the “Interiorcad Sales Info” database. It would be very important because I would have to change the database entries if there were a lot of symbols. Greetings Günther Sedlmeier Example database changing symbols.vwx Quote Link to comment
Pat Stanford Posted 13 hours ago Share Posted 13 hours ago Your file has no interiorcad objects, so I can't see if the database is selecting them properly or not. I need a file with a few samples (2-4) of objects to meet each of the two database criteria. Quote Link to comment
SedlmeierGuenther Posted 3 hours ago Share Posted 3 hours ago Hello Patrick, the file has symbols. They are in the accessories manager, not on the artboard. That is my challenge. Change the database of icons in the Accessory Manager without opening it. 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.