Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Optional Auto Update Date and Title Block with built-in Revision Table that can be called to override

CarterDraws
Contributor

Optional Auto Update Date and Title Block with built-in Revision Table that can be called to override

CarterDraws
Contributor
Contributor

Long time Autodesk user, medium understander of If/Then logic, but iLogic writing noob here.

I am using Inventor Professional 2020 at work.

 

I have 2 different scenarios that I want to each be able to affect the same main Title Block entry (/entries). Our Title Block's main "Date" and "Name" are meant to be the most current release date and the most current drafter. (I say "main" Date and Name because our Title Block has a built-in revision table of sorts with fields for dates and names. More on that farther down.)

 

Drafters in my company are frequently doing an initial drawing set of anywhere from 5-40 pages, and then a week later doing revisions that only affect 1-2 pages. When initially working on a drawing set, we want to be able to update the title block's main date on every page to Today's Date . Doing every sheet at once is great in this initial phase, because of the potentially large number of total sheets. But later, when doing revisions, we do not want every page's Date to update (because not every page has been revised) and we want to be able to manually enter the revision day's date in a separate Title Block field, which when not 0, changes the main date to the newly manually entered one.

Basically I would like to sometimes control the TB's date globally across all Sheets, and sometimes control it individually per Sheet.

The same goes for the Drafter field. Sometimes a different coworker is making the revisions to a drawing.

 

I have the basics of alot of the elements, but am missing the code writing know-how to string it all together.

The Title Block's 2 main fields for date and name are "Release Date" and "Drawn By". The Release Date is currently a Custom Drawing iProperty, <Most Recent Date>, and the Drawn By is a Custom Drawing iProperty, <Modified Author>.

We have an existing iLogic rule, "Modified By", to fill in <Modified Author> as the current User.

A different existing iLogic rule, "Date Update", changes the <Most Recent Date> property to Today's Date.

 

As mentioned above, the Title Block also has a revision table of sorts built into it. Right now, all of the fields for the revision history are manually-entered Prompted Fields such as <1st Ver Date>, <1st Ver Notes>, <2nd Ver Date>, <2nd Ver Name>, <2nd Version Notes>, etc. The "1st Ver Name" is the only one not manually entered, and is set to <Author> (with the thinking that the 1st Version should be the Original release date and original author).

 

So the global option of my request somewhat exists already in the "Date Update" rule. I have it Suppressed, and right-click and Run Rule when I need to globally update. That works just fine - I am not sure if it would play nice with my other request.

For the per sheet option, I am hoping for an iLogic Rule that would say For Each Sheet, read <5th Ver Date>. If it is not 0, make <Most Recent Date> = <5th Ver Date>. If it is 0, check <4th Ver Date>. If <4th Ver Date> is not 0, make <Most Recent Date> = <4th Ver Date>. And so on. There will always be something entered for <1st Ver Date>. Again, same desire for Drafter.

 

It seems like this would be possible with the right skills. If anyone can point me in the right direction or has a code that accomplishes some version of this, I am confident I could tweak it to work as I need.

Someone please feel free to tell me if it is pipe dream and not possible.

 

 

To add one more layer to it all: the Title Block also has a Prompted Entry manually-entered field to create a Revision watermark next to the TB. 

TB Revision Stamp entry.jpg

In a perfect world, the same Per Sheet iLogic Rule that is pushing the revision table fields to the main date and name, would also push whatever the most recent revision line's date was to this watermark stamp field, as long as it was <2nd Ver Date> or later. 

 

 

Any and all help is greatly appreciated.

Thanks!

0 Likes
Reply
410 Views
5 Replies
Replies (5)

A.Acheson
Mentor
Mentor

A starting point for you which will hopefully send you in the right direction.  See API help Titleblock.SetPromptResultText.

 

TitleBlock.SetPromptResultTextDefinitionText As TextBoxNewValue As String )

 

Here is a sample for copying prompted entry from one titleblock to another. A little off topic but gives you a good insight to how to structure for loops and retrieve the data. 

 

And here is another sample of querying promted entry in titleblocks. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes

CarterDraws
Contributor
Contributor

@A.Acheson thanks for the reply.

 

It seems these methods are for iLogic that is influencing prompted entries? I am looking iLogic that makes prompted entries influence custom i properties (I think).

 

Am I misunderstanding something about how you think I might use SetPromptResultText?

 

Or are you suggesting I change the main date and name to also be prompted entries to be influenced?

 

 

Thank you.

0 Likes

A.Acheson
Mentor
Mentor

You can either process the data by reading(Get) and writing (Set).  So when you get the result you let it equal a custom iproperty. Bearing mind iproperties are document based and not sheet based therefore you may need multiples in your document.

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes

CarterDraws
Contributor
Contributor

"Bearing mind iproperties are document based and not sheet based therefore you may need multiples in your document."

 

A solid point. I believe this means this is not the route I want to go. As I will never know the number of sheets needed per document from job to job. That is part of the reason I am looking for a global document wide update method and a per sheet update method for revisions.

0 Likes

A.Acheson
Mentor
Mentor

The only way this might work is with  prompted entry. As this can be used per sheet basis. It gets messy quickly however. The alternative is to switch to using the revision block object. This is a dedicated object for revision that would live out side of the title block. You can target the revision block per sheet. Just some ideas. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes