revision block - iLogic - design tracking properties

revision block - iLogic - design tracking properties

Anonymous
Not applicable
1,279 Views
4 Replies
Message 1 of 5

revision block - iLogic - design tracking properties

Anonymous
Not applicable

Inventor 2012, DWG drawing file Revision table - iLogic

Using iLogic, can anyone explain how to extract data from "Design Tracking Properties" in a revision table to an embedded or linked Excel spread sheet? Design Tracking Properties like "Today's Date", "Designer", "Checked By", "Eng Approved By" are of great interest.

0 Likes
1,280 Views
4 Replies
Replies (4)
Message 2 of 5

meck
Collaborator
Collaborator

I hope I understand you correctly. You want to populate an excel file with data from the iproperties?

 

This code will place the Checked By value into an embedded spreadsheet at cell location "A2"

GoExcel.CellValue("3rd Party:Embedding 1", "Sheet1", "A2") = iProperties.Value("Status", "Check By")

 

If you want to do it to an external spreadsheet replace "3rd Party:Embedding 1" with the pathway and filename of the spreadsheet. "Status" and "Checked By" can be replaced by any of the iproperties.

 

To go the other way from spreadsheet into the iproperties just flip the equation.

 iProperties.Value("Status", "Check By") = GoExcel.CellValue("3rd Party:Embedding 1", "Sheet1", "A2")

 

I hope this helps

Mike Eck
Master Drafter/ CAD Programmer
Using Inventor 2018
0 Likes
Message 3 of 5

Anonymous
Not applicable

Mike,

 

You're close, the hidden properties from the revision block are not visible in the iProperties.

Therefore, not available in iLogic?

 

Thank you,

 

Chuck

0 Likes
Message 4 of 5

meck
Collaborator
Collaborator

Not sure if you are still interested in this, but I have just started programming for revision blocks. If you can read the data from the revision table and then assign that to a property. Not sure this helps. There is an example in the help file to do this.

 

Regards

Mike Eck
Master Drafter/ CAD Programmer
Using Inventor 2018
0 Likes
Message 5 of 5

xiaodong_liang
Autodesk Support
Autodesk Support

I think the code demo Meck mentioned is as below (from help reference). I added one line to indicate how to set a property value to 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
            
            'simple demo. set a property to the cell
            'oCell.Text = oDrawDoc.PropertySets("Summary Information").ItemByPropId(kAuthorSummaryInformation).Value
        Next
    Next
End Sub

 

0 Likes