Jump to content
Stephen Sorenson

Flagging a Title block field as updated so vectorworks doesn't overwrite it

Recommended Posts

So I have a custom script that I've created that works in concert with the Vectorworks Title Block object. I import info from a csv file exported from our database and it loads in fields like sales person, venue, event name, etc into the title block (via Title Block Project Data.[record field]). It also creates/updates version numbering (outside of VW revision data which is difficult to work with via script for what we're trying to do) and puts the initials of the person who most recent revised it into a drafted by field. 

 

I had to make some edits for it to work with 2018 last year, but got suitable workarounds for the issues I was having, but they've gotten worse in 2019 as I'm working on our transition.

 

It seems that when I update the Record field it updates the title block visually, but the old information is retained "somewhere".  Previously it was only an issue if I replaced the title block (it would load default data into the fields unless I had subsequently edited the title block via the project settings - but I would only have to edit one field and it would flag all of the fields as changed. Now if I edit only one field via the built in settings it will only update that one field, but all others will revert to the previous state.

 

I was wondering if there is some way within the script to flag those fields as changed/edited so that they don't revert if I (or any of our other draftspeople) change anything via the built in editor.

Share this post


Link to post

Hello @Stephen Sorenson,

 

I suppose you are having issues only with the Project Data fields?

 

The Project Data in the Title Block Border is document wide. This means that it should be the same for all TBBs in the document. That is why, we have additional logic that keeps this data consistent. When you change the data for just one Title Block, it is becoming inconsistent with the document data and that is why it is getting overwritten.

 

If you do not want your changes to be overwritten, you will have to make them for the document too. This means that you will have to use SetRField and pass the handle of the Project Data format as first argument (you could take it with GetObject('Title Block Project Data') ).

However, keep in mind that this will not update the rest of the TBBs in the document to have consistent data, unless they get reset. You could run a foreach in the end of your changes in order to reset all TBBs in the document and make their Project Data consistent with the document project data.

 

Let me know if you have any other questions.

 

Best Regards,

Nikolay Zhelyazkov

Share this post


Link to post

@Nikolay Zhelyazkov

 

Thank you, that's exactly what I was looking for. I still had to keep my for loop to put the project data in each individual title block's project data record in addition to the Project Data format. I already had a ResetObject (and an HMove(h, 0, 0) for good measure).

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.

×