Creating Sheet-Scope Revision Table Using iLogic

Creating Sheet-Scope Revision Table Using iLogic

Anonymous
Not applicable
1,394 Views
2 Replies
Message 1 of 3

Creating Sheet-Scope Revision Table Using iLogic

Anonymous
Not applicable
Using some snippets from other threads, I created this rule (below) to check to see if there is already a revision table on a given sheet, and if so, to add a revision level, but if not, to create a new revision table. The problem I'm having is that the newly created table defaults to "Drawing" scope. We work with a lot of multi-sheet .idw files with different revision blocks on each sheet, and I would like the newly created revision table scope to default to "Active Sheet". Is there a way to build this into the iLogic rule, or better yet, change the default scope to "Active Sheet" for all inserted rev tables? I can't seem to find this as an option in Application Options or Document Settings. Anyway, here's what I have so far: Try Dim oDrawDoc As DrawingDocument = ThisApplication.ActiveDocument Dim oRevTable As RevisionTable = oDrawDoc.ActiveSheet.RevisionTables.Item(1) Dim oRow As RevisionTableRow oRow = oRevTable.RevisionTableRows.Item(oRevTable.RevisionTableRows.Count) If oRow.IsActiveRow Then For i = 1 To oRevTable.RevisionTableColumns.Count Dim oCell As RevisionTableCell = oRow.Item(i) oCell.Text = oCell.Text Next End If Dim oRows As RevisionTableRows = oRevTable.RevisionTableRows oRows.Add() Catch ex As ArgumentException Dim oDrawDoc As DrawingDocument oDrawDoc = ThisApplication.ActiveDocument Dim oRTBs As RevisionTables oRTBs = oDrawDoc.ActiveSheet.RevisionTables Dim oLocation As Point2d oLocation = ThisApplication.TransientGeometry.CreatePoint2d(24.355, 4.46) 'create and locate a new table Dim oRTB As RevisionTable oRTB = oRTBs.Add(oLocation) End Try Any help is much appreciated.
0 Likes
Accepted solutions (1)
1,395 Views
2 Replies
Replies (2)
Message 2 of 3

Curtis_Waguespack
Consultant
Consultant
Accepted solution

Hi msass6D3AR,

 

You want to add the table using the RevisionTables.Add2 method

 

I don't have a full working example to post at the moment, but in this snippet the IsSheetScope  is set to False.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

IsSheetScope Optional input Boolean that specifies the scope of the revision table - False indicates sheet scope and True indicates the entire drawing scope.

 

Syntax:

RevisionTables.Add2( PlacementPoint As Point2d, [IsSheetScope] As Boolean, [AutoIndex] As Boolean, [AlphaIndex] As Boolean, [StartValue] As String, [RevisionTableStyle] As Variant, [Layer] As Variant )

 

'add a new table
Dim oRTB As RevisionTable
oRTB = oRTBs.Add2(oLocation, False, True, True, "A", oRevStyle)
oRTB.Style = oRevStyle 'set the style

'ensure rev block is set to write to iProperty
oRTB.UpdatePropertyToRevisionNumber = True

EESignature

Message 3 of 3

Anonymous
Not applicable
Thanks, Curtis, for responding to my mess of a post. (For some reason, I'm unable to go back and edit it.) Anyway, your snippet was exactly that for which I was looking. Thanks again!
0 Likes