VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Check for changed Xref on DWG load

1 REPLY 1
Reply
Message 1 of 2
Anonymous
200 Views, 1 Reply

Check for changed Xref on DWG load

HI, what I'm looking to do is to find out if an XRef has changed since a drawing file was last loaded. I know in the command line you get a notice like this

Resolve Xref "BLAH": C:\dwg\BLAH.dwg
"BLAH" loaded.
"BLAH" reference file may have changed since host drawing was last saved.

But most of us where i am have the command line set to one or two lines of text and a message like that goes unnoticed. what i would like to do is use a message box pop up window saying what XRefs may have changed so their are no excuses like, "I didn't know it changed". any help at all would be most appreciated.

Thanks,

-Jakob
1 REPLY 1
Message 2 of 2
Anonymous
in reply to: Anonymous

This may help you, check the file for the time it was modified.
Late bind your code or set a reference to scripting runtime
[code]
Sub xstuff()
Dim f As File
Dim fs As Scripting.FileSystemObject
Dim x As AcadBlock, b As AcadBlock

Set fs = CreateObject("Scripting.FileSystemObject")

For Each b In ThisDrawing.Blocks
If b.isXref Then
Set x = b
Set f = fs.GetFile(x.Path)
Debug.Print f.DateLastModified
End If
Next
End Sub
[/code]

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

Post to forums  

Autodesk Design & Make Report

”Boost