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: 

Design Doctor

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
Skadborg.NTI
2369 Views, 6 Replies

Design Doctor

Can I in any way see if the Design Doctor "is active" - i.e. detect if I have a Red Cross:

 

DesignDoctor.png

There is a sample in the help, "Using Inventor's error dialog API Sample", but I can only record errors. I am running a long configuration rule, and I want to make sure that I don't start out with "legacy" errors.

 

6 REPLIES 6
Message 2 of 7
BrianEkins
in reply to: Skadborg.NTI

There were plans at one point to expose the Design Doctor through the API but it never happened.  However, you can still get some failure or error information by interrogating the model.  The VBA macro and function below check to see if any of the features in a part have problems.  To do a full check you would also want to check the health state of sketches and work features.

 

Public Sub TestProblems()
    Dim partDoc As PartDocument
    Set partDoc = ThisApplication.ActiveDocument

    If PartHasProblems(partDoc) Then
        MsgBox "Part has problems"
    Else
        MsgBox "Part is OK"
    End If
End Sub

Public Function PartHasProblems(partDoc As PartDocument) As Boolean
    Dim feature As PartFeature
    For Each feature In partDoc.ComponentDefinition.Features
        If feature.HealthStatus <> kUpToDateHealth And _
           feature.HealthStatus <> kBeyondStopNodeHealth And _
           feature.HealthStatus <> kSuppressedHealth Then
            PartHasProblems = True
            Exit Function
        End If
    Next
    
    PartHasProblems = False
End Function
---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
Message 3 of 7
Skadborg.NTI
in reply to: BrianEkins

Good idea - thank you 🙂

Message 4 of 7

Please, is this possible for drawing document, too? Thanks

Message 5 of 7

There is currently zero API capability for the drawing functionality. 

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
Message 6 of 7
steveh4
in reply to: Skadborg.NTI

Gang...

It's Inventor 2023 now. Any update on this? Still have to use VBA?

We are now putting welds into assemblies and when they fail, it's easily over-looked. Just want a message box that pops up when the the red cross is active telling the user that something is wrong. Plan on triggering it before a save. Unsure if I want to do just welds or when anything is wrong in an assembly. Might open a can of worms, but ohh well 🙂

Best,

Steve H.

Inventor---Vault Professional
Message 7 of 7
g.georgiades
in reply to: steveh4

I am seeing success by testing the button state (assuming the design doctor button is on the drawing quick access toolbar)

 

Dim rb = ThisApplication.UserInterfaceManager.Ribbons.Item("Drawing").QuickAccessControls.Item("AppDesignDoctorCmd")
If rb.ControlDefinition.Enabled Then
	MsgBox("Drawing has broken elements!")
End If

 

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

Post to forums  

Autodesk Design & Make Report