Jump to content

2018 Title Block fields?

Recommended Posts

I'm looking to modify the data contained in the revised Title Block tool via a script. In previous versions I had a worksheet embedded within my title blocks. In order to take advantage of the new field options I will need to modify a few scripts. Any help would be appreciated!




Share this post

Link to post

There are hidden records attached to each Title Block Border object:

Title Block Project Data

Title Block Sheet Data

Title Block Revision Data

Title Block Issue Data-x for each revision


I don't know to what extent the TBB error checks and refreshes according to the attached data, so be sure to do some testing.


Share this post

Link to post

OK, that was really helpful. Thanks! I had not realized that this was done with records.


In case this comes up for anyone else, this seems to work for me (Python script):

#User defined project name
strProjectName = vs.StrDialog('Set the project name','[changeme project name]');
#Sheet data record format and field
strRecordName = 'Title Block Project Data'
strRecordField = 'Project Name'

def SetRecord(h):
criteria = '((R in [' + "'" + strRecordName + "'" + ']))';

vs.ForEachObject( SetRecord, criteria);

The key is to use the ResetObject function after setting the drawing border field. Otherwise the record gets set but it doesn't display correctly until the drawing border is edited again. This works with Sheet data as well, but I have not messed with Revision or Issue at this point.


Note that I'm a terrible coder, so there's no error checking or anything like that. But it does work!





Share this post

Link to post


I wonder if there might be some more concrete examples of how to populate the new title block fields via vectorscript - I'm struggling to make much sense of it. Does anyone have any useful info on this please?

Share this post

Link to post

I have not played with it much, and not at all in Vectorscript, but it appears that there are a bunch of hidden records attached to the Title Block Object. you should be able to handle them the same way as any other Record.Field combination using GetRField and SetRField.



Share this post

Link to post

Pat - thanks - yes, in fact, that is exactly right (per Josh's previous post). The difficulty I was having was to figure out the names each record and field but, for anyone else who is wondering, the record names are as follows:

recname:='Title Block Project Data'; 
recname:='Title Block Sheet Data';


Once the record name is identified, the field names are exactly per the list - eg. "Project Name"

I haven't got as far as looking at the revision numbers or some of the other features yet....


BTW - to use Get / Set RfField, a handle is required to the relevant object. In this case, the object is the title block. The way I was (and still am) getting the handle was via h1:= GetObject('Border'); having named the title block 'Border'. Is that the most efficient way to get a handle to it, I wonder or is there a better way to select the object, directly? (It is an '86' ie. PIO). It would be great to have your thoughts on this.



Share this post

Link to post

There is an undocumented Criteria  PON  that takes the name of a type of PlugIn Object.


So if you only have a single title block on a layer, then something like


H1:=GetObject(((PON='Title Block Border') & (L=GetLName(ActiveLayer)));


Should get you the handle to the title block.


Criteria with functions/variables sometimes don't work so well, so you may want to build all of the criteria into a single string that you then use in the GetObject function.  I recommend using CHR(39) if you need to embed single quotes. Others will comment that you can use multiple single quotes in a row to "escape" the quotes, but I can't see well enough to distinguish a single quote from a double single quote from a double quote.



S1:=Concat('(((PON=',chr(39),'Title Block Border'.Chr(39),') & (L=',chr(39),S0,chr(39),')))');



The above has not been tested, so there may be typos, but it should get you close.



Share this post

Link to post

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.


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.

  • Create New...