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: 

Get active sheet revision

5 REPLIES 5
Reply
Message 1 of 6
Anonymous
580 Views, 5 Replies

Get active sheet revision

Anonymous
Not applicable

How can you retreive the active sheets revision? I can't find any reference to it anywhere in the API documentation.

 

 

0 Likes

Get active sheet revision

How can you retreive the active sheets revision? I can't find any reference to it anywhere in the API documentation.

 

 

5 REPLIES 5
Message 2 of 6
Anonymous
in reply to: Anonymous

Anonymous
Not applicable

I would imagine that it is set in the driving model file iProperties.

 

Out of the box I think it is called "Revision Number."

0 Likes

I would imagine that it is set in the driving model file iProperties.

 

Out of the box I think it is called "Revision Number."

Message 3 of 6
Anonymous
in reply to: Anonymous

Anonymous
Not applicable

Not the iProperty, the revision property associated with each individual sheet.

 

Right click on the sheet in the browser, select properties... that revision property.

0 Likes

Not the iProperty, the revision property associated with each individual sheet.

 

Right click on the sheet in the browser, select properties... that revision property.

Message 4 of 6
Mike.Wohletz
in reply to: Anonymous

Mike.Wohletz
Collaborator
Collaborator

Will it work for you to pull it from the revision table?

 

    Public Function GetSheetRevision() As String
        Dim Revision As Integer = Nothing
        Dim oDrawDoc As DrawingDocument = oApp.ActiveDocument
        Dim oRevisionTable As RevisionTable = oDrawDoc.ActiveSheet.RevisionTables.Item(1)
        For Each oRevRow As RevisionTableRow In oRevisionTable.RevisionTableRows
            Try
                ' we will deal with it as ASCII characters so it will handle either numbers
                ' or letters, but not both.
                'I have guessed that the secont column holds the revision number
                If System.Text.Encoding.ASCII.GetBytes(oRevRow.Item(2).Text)(0) > Revision Then
                    Revision = System.Text.Encoding.ASCII.GetBytes(oRevRow.Item(2).Text)(0)
                End If

            Catch ex As Exception

            End Try
        Next
        Return Chr(Revision)
    End Function

 

0 Likes

Will it work for you to pull it from the revision table?

 

    Public Function GetSheetRevision() As String
        Dim Revision As Integer = Nothing
        Dim oDrawDoc As DrawingDocument = oApp.ActiveDocument
        Dim oRevisionTable As RevisionTable = oDrawDoc.ActiveSheet.RevisionTables.Item(1)
        For Each oRevRow As RevisionTableRow In oRevisionTable.RevisionTableRows
            Try
                ' we will deal with it as ASCII characters so it will handle either numbers
                ' or letters, but not both.
                'I have guessed that the secont column holds the revision number
                If System.Text.Encoding.ASCII.GetBytes(oRevRow.Item(2).Text)(0) > Revision Then
                    Revision = System.Text.Encoding.ASCII.GetBytes(oRevRow.Item(2).Text)(0)
                End If

            Catch ex As Exception

            End Try
        Next
        Return Chr(Revision)
    End Function

 

Message 5 of 6
Anonymous
in reply to: Anonymous

Anonymous
Not applicable
Unfortunatly, we don't use the tables, just the rev property.
0 Likes

Unfortunatly, we don't use the tables, just the rev property.
Message 6 of 6
Anonymous
in reply to: Anonymous

Anonymous
Not applicable

Same Probleme .... Have you a solution ?

I don't use RevisionTables, just a text

0 Likes

Same Probleme .... Have you a solution ?

I don't use RevisionTables, just a text

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

Post to forums  

Autodesk Design & Make Report