Apply "One Color" in Application Options/Display Appearance

Apply "One Color" in Application Options/Display Appearance

jason-dave.baker
Contributor Contributor
958 Views
6 Replies
Message 1 of 7

Apply "One Color" in Application Options/Display Appearance

jason-dave.baker
Contributor
Contributor

Hi,

In an iLogic formula, I am looking for a way to Store the initial setting from Application options/Display Appearance/Model edges in a variable, Switch it to One Color (Black), Run a portion of an Ilogic, and then Switch it back to the stored initial settings.

Anyone knows the code line to access these options and apply the right value?

I have been trying with this line but cannot get it to apply anything or read anything:

ThisApplication.DisplayOptions.EdgeColor

I am working with Inventor 2021

 

Thank you!

0 Likes
Accepted solutions (1)
959 Views
6 Replies
Replies (6)
Message 2 of 7

Andrii_Humeniuk
Advisor
Advisor

Hi @jason-dave.baker . I found the link in your question. An example of how to change the color of edges:

 

ThisApplication.DisplayOptions.EdgeColor = ThisApplication.TransientObjects.CreateColor(255, 0, 0)

 

Andrii Humeniuk - CAD Coordinator, Autodesk Certified Instructor

LinkedIn | My free Inventor Addin | My Repositories

Did you find this reply helpful ? If so please use the Accept as Solution/Like.

EESignature

Message 3 of 7

jason-dave.baker
Contributor
Contributor

Hi @Andrii_Humeniuk , unfortunately this does not change anything in the options.

0 Likes
Message 4 of 7

WCrihfield
Mentor
Mentor

Hi @jason-dave.baker.  Quick question...do you have the radio button setting on that tab set to "Use document settings" or "Use application settings"?  If it is set to Use document settings, then that line of code will not effect the application options.  There is also the API setting for that at ThisApplication.DisplayOptions.UseDocumentDisplaySettings, which is a Read/Write Boolean.

If you want to effect the settings of your specific document, you can go to PartDocument.DisplaySettings.EdgeColor.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 5 of 7

jason-dave.baker
Contributor
Contributor

It is set to Use Application Settings.

jasondavebaker_0-1688657508520.png

I want to be able to use it on either Assembly or Part document. 

0 Likes
Message 6 of 7

Curtis_Waguespack
Consultant
Consultant
Accepted solution

Hi @jason-dave.baker 

 

You can try this example.

 

Note that in Inventor 2022 and beyond the options have changed. This example will toggle between the first and the third, but I was not able to get it to switch from the 2nd to the 3rd.

 

I don't have 2021 installed to test with.

 

Curtis_Waguespack_0-1688752271691.png

 

ThisApplication.DisplayOptions.UseDocumentDisplaySettings = False

Dim oNewColor As Color = ThisApplication.TransientObjects.CreateColor(0, 0, 0)

'get  current color ( this will be nothing if the Application Settings is using "contrast with background" )
Dim oCurrentColor As Color = ThisApplication.DisplayOptions.EdgeColor 

'set to color
ThisApplication.DisplayOptions.EdgeColor = oNewColor

MsgBox("Pause to note edge color...",,"iLogic")

'set back to the current color
ThisApplication.DisplayOptions.EdgeColor = oCurrentColor

 

0 Likes
Message 7 of 7

jason-dave.baker
Contributor
Contributor

Thank you @Curtis_Waguespack , it worked in Inventor 2021 and it was exactly what I needed!