Jump to content

Worksheet - Grouping a drawing schedule


Recommended Posts

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

Link to comment

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.

  • Like 1
Link to comment

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.

Link to comment

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

Link to comment
  • 2 weeks later...

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

Link to comment

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 😉

 

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...