iLogic access to Drawing Sheet revision

iLogic access to Drawing Sheet revision

DJFore
Advocate Advocate
1,892 Views
1 Reply
Message 1 of 2

iLogic access to Drawing Sheet revision

DJFore
Advocate
Advocate

Does anyone know how to access the drawing sheet revisions using Ilogic.

My company is wanting to start making the default inital rev on a drawing a "-" and inventor does not like to keep this when brought in as a template.

So like normal I am trying to trick it into having the dash untill a rev is actually added. 

Any suggestions on a way to make this happen would be greatly appreciated.

 

 

0 Likes
1,893 Views
1 Reply
Reply (1)
Message 2 of 2

Vladimir.Ananyev
Alumni
Alumni

It is possible to get access to revision table from iLogic rule using calls to Inventor API objects.  The following rule returns title and number of rows in the first revision table on the active sheet.

Dim oDoc As DrawingDocument = ThisDrawing.Document
Dim oSheet As Inventor.Sheet =  oDoc.ActiveSheet
 
Dim oRevTable As RevisionTable = oSheet.RevisionTables.Item(1)

MsgBox( "Rows: " & oRevTable.Title)
MsgBox( "Rows: " & oRevTable.RevisionTableRows.Count)

 

Properties and methods of RevisionTable object are described in Inventor API help.   Here is the VBA sample from this help.   RevisionTableCell object has property Text that gets and sets the text of the cell.

Public Sub RevisionTableQuery()
    ' Set a reference to the drawing document.
    ' This assumes a drawing document is active.
    Dim oDrawDoc As DrawingDocument
    Set oDrawDoc = ThisApplication.ActiveDocument

    ' Set a reference to the first revision table on the active sheet.
    ' This assumes that a revision table is on the active sheet.
    Dim oRevTable As RevisionTable
    Set oRevTable = oDrawDoc.ActiveSheet.RevisionTables.Item(1)

    ' Iterate through the contents of the revision table.
    Dim i As Long
    For i = 1 To oRevTable.RevisionTableRows.Count
        ' Get the current row.
        Dim oRow As RevisionTableRow
        Set oRow = oRevTable.RevisionTableRows.Item(i)

        ' Iterate through each column in the row.
        Dim j As Long
        For j = 1 To oRevTable.RevisionTableColumns.Count
            ' Get the current cell.
            Dim oCell As RevisionTableCell
            Set oCell = oRow.Item(j)

            ' Display the value of the current cell.
            Debug.Print "Row: " & i & ", Column: " & oRevTable.RevisionTableColumns.Item(j).Title & " = "; oCell.Text
        Next
    Next
End Sub

Cheers,


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

0 Likes