iLogic/VBA - enable "Show Constraint State"

iLogic/VBA - enable "Show Constraint State"

amarcoc
Advocate Advocate
624 Views
5 Replies
Message 1 of 6

iLogic/VBA - enable "Show Constraint State"

amarcoc
Advocate
Advocate

Hi.

 

Is there a way to enable "Show Constraint State" option using iLogic or VBA?

 

I couldn't find a way to do it.

 

Screenshot_2.png

 

Thanks.

0 Likes
Accepted solutions (1)
625 Views
5 Replies
Replies (5)
Message 2 of 6

WCrihfield
Mentor
Mentor
Accepted solution

Hi @amarcoc.  I'm having a hard time just trying to find the manual way you are showing in your image.  What version of Inventor are you using, and what exactly have you right clicked on to get those two menu's to show.  I can see that you have a weldment type assembly open, but that's about it.

I think I may have found the setting that you are referring to within the API though.  Is this what you were looking for?

Dim oADoc As AssemblyDocument = ThisDoc.Document
oADoc.ModelingSettings.ShowConstraintStateInBrowser = True

 

If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.

If you want and have time, I would appreciate your Vote(s) for My IDEAS :bulb: or you can Explore My CONTRIBUTIONS

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 6

amarcoc
Advocate
Advocate

Yes.

 

That's it (using Inventor 2022). It's this function: https://knowledge.autodesk.com/support/inventor/learn-explore/caas/CloudHelp/cloudhelp/2022/ENU/Inve...

 

How did you find it on API? How could I have found it myself? 🙂

 

I just added the code to update the document after enabling it, since it's required.

 

Dim oADoc As AssemblyDocument = ThisDoc.Document
oADoc.ModelingSettings.ShowConstraintStateInBrowser = True
InventorVb.DocumentUpdate()

 

Message 4 of 6

WCrihfield
Mentor
Mentor

It looked slightly familiar, but I couldn't recall where I was a setting like that before, so I started checking the 'usual suspects' (Application Options - Assembly tab & Display tab ; Document Settings).  After opening one of my assemblies, and checking the Document Settings (Tools tab > Options panel > Document Settings), I saw that setting on the 'Modeling' tab.  (Luckily I am also still using Inventor 2022.2.2.)  That gave me the clue I needed to find it within the API, because I already have some rules for setting up document settings the way I want them.  Since this is a new setting for 2022, and frankly was not that important to me, I had not altered my code to include it yet, but knew where to find it.  Most of the settings within the application options and document settings can be accessed by code now, but not all.  Glad I was able to help.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 5 of 6

WCrihfield
Mentor
Mentor

Even after seeing your response post and the link, it still took me a bit to figure out where that little menu was being displayed from.  I had looked on the Assemble tab, Tools tab, Manage tab, View tab, Object Visibility tool and User Interface tool on the View tab...had right clicked on just about everything I could think of in the model browser, and still had not seen that menu available.  Then I finally clicked the little three bar symbol to the right of the Model * iLogic tabs of the model browser, and finally found it.  Whew.  It's always in the last place you check. 😁

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 6 of 6

amarcoc
Advocate
Advocate

Thanks. Great help 🙂

0 Likes