VBA Check design doctor for errors in drawing

VBA Check design doctor for errors in drawing

pball
Mentor Mentor
1,879 Views
5 Replies
Message 1 of 6

VBA Check design doctor for errors in drawing

pball
Mentor
Mentor

Is there a way to check in VBA if the design doctor has found errors in a drawing? I have a mass print script and it'd be handy to be able to skip printing any drawings that have errors like unatached dimensions and such.

Check out my style edits for the Autodesk forums
pball's Autodesk Forum Style
0 Likes
1,880 Views
5 Replies
Replies (5)
Message 2 of 6

philippe.leefsma
Alumni
Alumni

Hi There,

 

Take a look at the "ErrorManager Interface" in the help files, you can find samples there.

 

Public Sub ErrorManager()

    Dim errorMng As ErrorManager
    Set errorMng = ThisApplication.ErrorManager
    
    Dim errors As String
    errors = errorMng.AllMessages
    
End Sub

Regards,

Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 6

pball
Mentor
Mentor

Thanks for the help. This should help me do exactly what I want to do.

Check out my style edits for the Autodesk forums
pball's Autodesk Forum Style
0 Likes
Message 4 of 6

ChristiPedersen
Advocate
Advocate

I tried this and all I get is <ErrorsAndWarnings/> even though I can see errors in the sketch doctor.  An suggestions?  Is there maybe a document error manager?

0 Likes
Message 5 of 6

pball
Mentor
Mentor

The method above apparently can only pick up errors that happen while your code is running. If you just want to see if a document has an error or not there is a solution in a more recent thread of mine.

 

https://forums.autodesk.com/t5/inventor-customization/bug-with-checking-errormanager-with-vba/m-p/49...

Check out my style edits for the Autodesk forums
pball's Autodesk Forum Style
0 Likes
Message 6 of 6

ChristiPedersen
Advocate
Advocate

I read the thread.  Thank you so much.  I will test it.

0 Likes