Andrew Davies Posted October 22, 2019 Share Posted October 22, 2019 Hello I have a worksheet which I am using as a drawing schedule - currently approx 30 sheets and growing. Each sheet is organised A-XXX-XXX, B-XXX-XXX, C-XXX-XXX etc etc The Drawing schedule has sub titles. ie - A= General, B = Architectural. I would like the schedule to have a subheading over each section, I've currently got a separate database criteria to pull out only the A drawings (for example). I did this by adding a sheet field for "Category" - so I can manually select A, B or C etc per sheet. But just thinking - it would be much better to pick out the relevant sheets by using the first letter of the sheet number - ie IF (LEFT(XXX,1) = "A". I can't see a formula to do this - can anyone help? My current formula is : =DATABASE(((PON='Title Block Border') & ('Title Block Sheet Data'.'Sheet Category'='A'))) I would effectively like to change this to : =DATABASE(((PON='Title Block Border') & LEFT('Title Block Sheet Data'.'Sheet Number'),1) = "A" but I can't get the syntax to work. Any help greatly appreciated as always! Andrew Quote Link to comment
Pat Stanford Posted October 22, 2019 Share Posted October 22, 2019 Left is not a valid function in a worksheet. Try SubString('Title Block Sheet Data'.'Sheet Number','-',1) to get the first part of the sheet number. Note that SubString works on delimiters, not on number or characters, so if someone used 'AB' in front of the first dash you would get AB back, not just the A. String handling in worksheets could certainly use some love. 1 Quote Link to comment
Andrew Davies Posted October 24, 2019 Author Share Posted October 24, 2019 Thanks Pat - I knew you would come to the rescue! I am using : =DATABASE(SUBSTRING('Title Block Sheet Data'.'Sheet Number', '-', 1)='A') But it is not returning anything. No error. Am I missing a step? Thanks again, Andrew Quote Link to comment
Pat Stanford Posted October 24, 2019 Share Posted October 24, 2019 I don't think you are missing anything. Using SubString in the database function just does not seem to work. There is a new RunDatabaseScript function that gives more control over what is displayed and the order, but I have not had time to play with it yet. I will try to make some time this weekend. Until then, Can you just add an extra column and put the Substring in there? Sort on the substring column. Set the Row Height of everything that is not A to zero and set the column width Set the Substring column width to zero. You will have to un-zero to check the settings, but if you number of sheets does not change often it could be a reasonable work around. Quote Link to comment
Vectorworks, Inc Employee Hugues Posted October 28, 2019 Vectorworks, Inc Employee Share Posted October 28, 2019 @Andrew Davies Did you know that the asterisk (*) wildcard can be used in worksheet criteria? You could use the following formula: =DATABASE(((PON='Title Block Border') & ('Title Block Sheet Data'.'Sheet Category'='A*'))) 1 Quote Link to comment
Pat Stanford Posted October 28, 2019 Share Posted October 28, 2019 And in VW2020 there is a new capability called DatabaseByScript. Using this function as the database criteria allows the user to specify a subset of a criteria and/or change the order that items are added to the database. The basic idea is that instead of specifying the criteria for the database, you specify a script to run. Then in the script you get a handle to each object to be included in the database and use the WSScript_AddHandle procedure to mark those objects to be part of the database. In the attached file, the script AddToWS is being used to define the database in Row 3 of the worksheet. Row 5 is using just the Sheet Data record being present and returns the sheet borders no matter what the first character. Row 7 uses Hugues wildcard method from above. Wildcard is probably best for this application, but if you want to get much fancier, the script is the way to go. Database by Criteria Demo.vwx Quote Link to comment
Andrew Davies Posted November 12, 2019 Author Share Posted November 12, 2019 Thanks again for this Pat. Appreciate it. Scripting is somewhat out of my league - but I will give it a go. Do you mind if I ask another quick question? Is it possible to pull data from a sheet border that is contained in a separate file? The file could be referenced in. In a nutshell, a colleague has created a set of drawings using the exact same border but in a separate file. I would like to include his drawings in my drawing schedule. That possible? Thanks again, Andrew Quote Link to comment
Pat Stanford Posted November 12, 2019 Share Posted November 12, 2019 I don't know if it is possible or not. But probably not. I don't think you can reference Sheet Layers, only Design Layers. If you can reference them in, then you should be able to get to them with a worksheet and/or script. Just played a little and did not come up with a good way. One option might be to put the worksheet in each file and then an image on a design layer that you can reference in a a viewport. Then just stack the viewports form different files. But this will not allow you to interleave the numbers. So if you have A1, A2, A4 and the other file has A3, you can't use viewported worksheets to make it sort as A1, A2, A3, A4. And I am happy to help with the scripting 😉 Quote Link to comment
Boh Posted November 12, 2019 Share Posted November 12, 2019 Low tech workaround: Import the sheet layers from the other file? They can remain blank - except for a title block which will need manual updating if there are changes to the revision or sheet data. Quote Link to comment
Vectorworks, Inc Employee Nikolay Zhelyazkov Posted November 13, 2019 Vectorworks, Inc Employee Share Posted November 13, 2019 You could try using the TBManager and the multiple pages worksheets. If a worksheet is multi page it will collect information from all TBBs in the TBManager selection, including external files. 2 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.