Jump to content

Worksheet for Table of Contents : Sheet Information

Recommended Posts

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.

Link to comment

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



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

Link to comment

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}

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



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







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.











  • Like 1
Link to comment



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.

Link to comment
2 hours ago, Pat Stanford said:



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?





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

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

Link to comment

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.

Link to comment

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.



Link to comment

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.







  • Like 1
Link to comment

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,



Link to comment

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.





TOC 2.vwx

Link to comment

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


Link to comment



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
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.

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...