Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iLogic access to Drawing Sheet revision

1 REPLY 1
Reply
Message 1 of 2
DJFore
1797 Views, 1 Reply

iLogic access to Drawing Sheet revision

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.

 

 

1 REPLY 1
Message 2 of 2
Vladimir.Ananyev
in reply to: DJFore

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report