Jump to content
Ethan R.

Worksheet for Table of Contents : Sheet Information

Recommended Posts

 

Hi,

 

Trying to build a worksheet to reference:

 

Sheet Number

Sheet Title

Sheet Description

 

And then also be able to put them in the Title Block.

 

Is there a way to do this?  I can't figure out the syntax.

 

Or do I have to use the TitleBlock Tool ?

 

Thanks

Ethan

 

Share this post


Link to post

The "simplest" way of doing this is to use the Drawing Border object. If you don't want the border, there is a Title Block only mode of the object. This object will have a Record attached to it. You can then call the information from the Title block record into a worksheet. The record and field will depend on what title block you select.

 

You could also create your own record format, create a title block symbol and do Link Text to Record to store this information in a record.

 

Record information can be accessed in a worksheet database row using a formula like ='Record'.'Field'

 

If you need more information, let us know more exactly what you are doing and we can provide more exact answers.

Share this post


Link to post

Thanks Pat 

 

I want to create a TOC that utilizes the same info I use to "publish" a drawing set.

- So i don't want to use custom fields -

 

I want to be able to reference Drawing #'s, Names & Descriptions from the Organization window (see screenshot).

I would like to display the info  in my title block AND in a TOC worksheet as a cover page.

 

Thank you

Ethan

 

Screen Shot 2016-11-02 at 11.35.52 PM.png

Share this post


Link to post

I also use Pat's method of using border objects and title blocks and calling the record format attached to that.

 

For the table of contents usually concatenate the 3 name fields.  So it looks something like this:  

 

=CONCAT(('TitleBlockRec-Example'.'S_ShtTitle Line 1_SD'), ' ', ('TitleBlockRec-Example'.'S_ShtTitle Line 2'), ' ', ('TitleBlockRec-Example'.'S_ShtTitle Line 3'))

 

I don't think you can get the description directly from a worksheet database call.  But I think you can script it.  

 

This actually works.  It throws and error code, but then it works anyway.

 


Procedure WhatsTheDescription;
{Badly scripted by Michael Klaers}

VAR
    
    TBHand                        : HANDLE;     
    LayerHand                    : HANDLE;
    DescText, LayerNum            : DYNARRAY[] OF CHAR;

    

BEGIN

    
    TBHand := WSScript_GetObject;
    LayerNum := GetRField(TBHand, 'TitleBlockRec-Example','S_Sheet Number_SN');
    LayerHand := GetObject(LayerNum);    
    GetDescriptionText(LayerHand,DescText);
    WSScript_SetResStr(DescText);

 

 

    END;

RUN(WhatsTheDescription);

 

 

If@PatStanfordor any of the VS brain trust has 3 idle minutes they can spot the error.  I give up.

 

I'll include a file with 2 examples.  The left example uses a new field in the title block record.  You can double click on the title block to edit this field.

 

The trickier one uses a script executed from a cell in the worksheet to get the description of the sheet layer that the title block is in.  After throwing a code - it works.  

 

Every time you recalculate a worksheet you will get the error message.  Dismiss it and it will work.  At least it does for me.

 

hth

 

mk

 

 

 

 

 

TOC.vwx

  • Like 1

Share this post


Link to post

Michael,

 

Nice work. Is this the Error Message you are getting 

 

Screen Shot 2016-11-03 at 7.37.08 PM.png

Because if it is I think it is just a general security warning and it would be OK to click the Always Execute Scripts. Personally, I would rather have a setting to Always Execute This Script rather than all scripts.

 

I did not see any other error messages besides this one. It seems to work well.

Share this post


Link to post

Hi, Go Records / Create a report and in the list objects with record select the VAA title block or the type of title block you are using. You can then choose all you need from the list to populate your worksheet.

HTH

Capture.JPG

Share this post


Link to post
2 hours ago, Pat Stanford said:

Michael,

 

I did not see any other error messages besides this one. It seems to work well.

 

I'm getting this:

 

I'm very interested if this is only my computer.  I've found that many of my old dependable scripts have suddenly started kicking out errors.  If you click OK, they still work.

 

Is it possible that I've got something wrong with my installations of both 2016 and 2017?

 


mk

 

 

Screen Shot 2016-11-04 at 12.13.48 AM.png

Screen Shot 2016-11-04 at 12.13.59 AM.png

Share this post


Link to post

Well I'm not getting the error here on the file you sent over, so there is certainly some problem on your end.

 

It sounds like the WSScript_GetObject is not returning a valid object on your machine. I would put some debug code in and see what it is really returning. I would start with Message(Date(2,2),'  ',WSScript_GetObject); right above the tbHand= line. If it returns 0 (zero) then the handle is nil and you don't have an object. If it returns a number then you have a good handle.

 

Could you possibly have a call to the script that is not in the database row from when you were testing? That would probably return a nil handle. Remember in the database, the script is called for each object found in the database.

Share this post


Link to post

Pat

 

Great idea.  Just tried it.

 

In the file I posted I get a 0 in the message + an error dialog.  Hit OK and then an actual value on the second message (only two objects in the database) and the script works.  

 

??????

Share this post


Link to post

This is really weird, but it sounds like your worksheets are off by one row somehow. It appears that it is getting the information from the header row first then the first row.  I have no idea how that could happen, but that would explain your out of bounds problems also.  See my private message.

Share this post


Link to post

So that script could have been shorter.  I kept trying different ways of getting the handle to the sheet layer because of the error messages.

 

arrrggg.

 

 

Share this post


Link to post

Lots of great info here!

 

But the original question is "how do I reference the Sheet Names / Number / Description from the Organization Dialogue box?

 

If I enter then names there - I want my title block to reference them

 

Using the Sheet Border Tool - I have to put the information into each info pallet and each title block separately.

 

It seems much more straight forward - and much better organized - to pull the information from the "Organization" Pallet.

 

Obviously this is recorded - so I would like to pull it to use in my title block.

 

This will keep everything aligned when I use the Publish Tool.

 

Thanks
Ethan

Share this post


Link to post

If you have automatic drawing coordination turned on AND the name of your sheet number field ends in _SN and the sheet name field ends in _SD, then the title block will pick up the sheet number and sheet name from the organization dialog box.  That data will flow through to the worksheet database pulling from the title block record.

 

The second worksheet in my example file will pull the description from the sheet description in the organization dialog box using a little script.

 

 

hth

 

 

mk

  • Like 1

Share this post


Link to post

Hi mk

 

Very impressive as I poke my head around the file. 

I'm seeing a lot of the items I was interested in learning about!

 

Question: Is there a reason that the Filename and Total Sheets do not pull automatic values?

 

Sorry if this is a silly question - I'm kind of beat here on late Sunday night.

 

Thank you much,

_ER

 

Share this post


Link to post

No they don't.  Neither of those values are part of the sheet layer.

 

But you can fake the file name and number of sheets.

 

I like to put one or two Data Stamp objects in my title block symbol.  Then every time I print it always has today's date and the name of the file.  You can use a worksheet to pull the name of the file from the data stamp object.

 

To get a count of sheets you can count the number of sheet borders.  There are two methods for counting sheet borders in the attached file.

 

hth

 

mk

TOC 2.vwx

Share this post


Link to post

Pretty Great work -  IMHO

 

I apologize for any circular questioning ..

 

This brings me to a question I posted on another thread ... Is there a comprehensive list of functions that can be called out in a worksheet?

- the only lists I can seem to find are:

  1. http://developer.vectorworks.net/index.php/VS:Search_Criteria#Search_Criteria_Tables
  2. http://developer.vectorworks.net/index.php/VS:Function_Reference_Appendix#attrCrit
  3. http://kbase.vectorworks.net/questions/1089/Worksheet+Functions+-+Doors
  4. http://kbase.vectorworks.net/questions/1090/Worksheet+Functions+-+Plants
  5. http://kbase.vectorworks.net/questions/1088/Worksheet+Functions+-+Windows

 

The kbase articles look the most promising - but there is not a full list I can find?

 

For Example:

You use :  =('Data Stamp'.'FileName')

 

Where does one find the function callout ?  

 

Data Stamp'.'FileName

  Is there a comprehensive list of all callouts?

 

Thank you for your time

Ethan

Share this post


Link to post

Ethan

 

There isn't a comprehensive list.  That I know of.  If there was it would be HUGE.

 

Here are a couple of strategies:

 

1.  Use Pat Stanford's scripts.  You can get them in the resource share - vector script part of this forum.  I just looked and couldn't find it.  So I added it to the attached file.  Just select an object and run the script.  A worksheet will appear that lists all the record.field names of records attached to that object.  If you get interested in scripts, it's fun to look at other scripts people have posted there.  Saying I find that fun probably says too much about my life.

 

2.  Use the Report… command to create a report of all objects with the attached record.

 

3.  To find the Data Stamp.FileName:  I just know from experience that that is one of those weird fields.  I assume because it may be read only.  You wouldn't want someone changing the name of the file in a worksheet!  

 

I found it by cheating.

 

I just opened a blank document, inserted a data stamp, then exported that file to a vector script.  Then I opened that in a text editor (BBEdit, but you can use anything.  Probably even MS Word.) and looked for the name of the file.  That told me the name of the record field.

 

 

TOC 3.vwx

  • Like 2

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×