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: 

Test to see if document has changed

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
CAD-e-Shack
609 Views, 5 Replies

Test to see if document has changed

Is there a test I can do to a drawing to see if it has been modified since opening?

 

The code I've written needs to be able to differentiate so as to minimize user input. I can make it work one way or the other,but I need some sort of marker that I can insert into an if statement to determine whether to simulate user input for changes made, or exit with no changes.

5 REPLIES 5
Message 2 of 6

Try adding ModelGeometryVersion to an attribute and compare the ModelGeometryVersion for changes.

Message 3 of 6

I may need to be treated like a vba rookie here.

 

I was hoping to find something like what Excel has where I can test if "Activeworkbook.saved = true" which means there have been no changes since the last save.

 

I tried setting up attributes, but I really have little undestading what they reference to and how they work.

Message 4 of 6

ModelGeometryVersion can used to track the changes made to the referenced part of the drawing. If you want to check the drawing only  try the below code.

Public Sub Drawing_Change()
    Dim oDoc As DrawingDocument
    Set oDoc = ThisApplication.ActiveDocument
   
    If oDoc.Dirty = True Then
        MsgBox ("Changes Have been made")
    Else
        MsgBox ("No changes made")
    End If
End Sub

 this will show if any changes made after the last save.

Message 5 of 6

OK, I see how it works. I was looking to compare it to the checked-out file. If there were no changes since check-out then a save & check-in would be required.

 

As is, if there have been saved changes since check-out the system reads the file as not having changed at all.

Message 6 of 6

How to check wheher the drawing Drawing document has been modified or not? 

ModelGeometryVersion is not the part of drawing document.

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

Post to forums