Hi.
I'm hoping someone can help with this. I have a rule in the .idw drawing template, that displays a dialog box asking for the size (A, B, C, D...). Once the size is selected, it displays the appropriate border and title block. There is a small & large title block, so an A or B size gets the small, and a C or larger gets the large. This works great.
My question is, how can I have the appropriately sized Revision Table (small or large), automatically ready for use, based on the drawing size? The (2) Revision Tables are defined in the Styles library.
Thanks in advance.
Bob
Solved! Go to Solution.
Solved by Curtis_Waguespack. Go to Solution.
Solved by MechMachineMan. Go to Solution.
Can anybody help with this?
TIA
of thread - but I have a similar issue.
I have 2 different revision tables and need to be able to swap them out via illogic.
Has anyone done something similar?
TIA
Yes, there is a way
RevisionTable.Style Property Parent Object: RevisionTable Description Property that gets and sets the style associated with this object. Syntax RevisionTable.Style() As RevisionTableStyle
@lynlaysaymo wrote:
of thread - but I have a similar issue.
I have 2 different revision tables and need to be able to swap them out via illogic.
Has anyone done something similar?
TIA
Hi lynlaysaymo,
Here is an example that toggles between two named rev table styles.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Dim oDrawDoc As Inventor.DrawingDocument = ThisApplication.ActiveEditDocument 'set rev block style Dim oRevTable As RevisionTable Dim oRevStyle1 As RevisionTableStyle oRevStyle1 = oDrawDoc.StylesManager.RevisionTableStyles.Item("RevBlock Style1") Dim oRevStyle2 As RevisionTableStyle oRevStyle2 = oDrawDoc.StylesManager.RevisionTableStyles.Item("RevBlock Style2") Dim oCurrentNumber As Sheet oCurrentNumber = oDrawDoc.ActiveSheet For Each oSheet In oDrawDoc.Sheets oSheet.Activate Try ' Get the revision table oRevTable = oDrawDoc.ActiveSheet.RevisionTables.Item(1) 'toggle rev style If oRevTable.Style.Name = "RevBlock Style1" Then oRevTable.Style = oRevStyle2 Else oRevTable.Style = oRevStyle1 End If oSheet.Update Catch 'catch error Return 'exit when no rev table is found End Try Next 'sheet
thanks guys works well, cant accept as solution as I hijacked an old thread 😞
Here's a quick update to the last rule I posted.
That one exited the rule if no rev block was found on a sheet, rather than skipping the sheet and moving on to the next one.
This one behaves as expected:
Dim oDrawDoc As Inventor.DrawingDocument = ThisApplication.ActiveEditDocument 'set rev block style Dim oRevTable As RevisionTable Dim oRevStyle1 As RevisionTableStyle oRevStyle1 = oDrawDoc.StylesManager.RevisionTableStyles.Item("RevBlock Style1") Dim oRevStyle2 As RevisionTableStyle oRevStyle2 = oDrawDoc.StylesManager.RevisionTableStyles.Item("RevBlock Style2") Dim oCurrentNumber As Sheet oCurrentNumber = oDrawDoc.ActiveSheet For Each oSheet In oDrawDoc.Sheets oSheet.Activate Try ' Get the revision table oRevTable = oDrawDoc.ActiveSheet.RevisionTables.Item(1) 'toggle rev style If oRevTable.Style.Name = "RevBlock Style1" Then oRevTable.Style = oRevStyle2 Else oRevTable.Style = oRevStyle1 End If oSheet.Update Catch 'catch error Continue For move on when no rev table is found End Try Next 'sheet oCurrentNumber.Activate