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: 

Change Color Scheme through iLogic

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
Arnsteinh
1236 Views, 7 Replies

Change Color Scheme through iLogic

Is it possible to change the color scheme (switch between Millennium and Presentation etc. with ilogic roles? Does anybody knows how to code this?

 

Arnstein

7 REPLIES 7
Message 2 of 8
QuasiMojo
in reply to: Arnsteinh

Bump

Message 3 of 8
cwhetten
in reply to: QuasiMojo

The following line of code sets the active color scheme:

 

ThisApplication.ColorSchemes("Winter Day").Activate

 

Place the name of whichever color scheme you want in quotes.  If you wanted it to toggle back and forth between two schemes, more code would be needed, but this should get you started.  Post back if you have more questions.

 

Cameron Whetten
Inventor 2014

Message 4 of 8
QuasiMojo
in reply to: cwhetten

Many thanks.
Message 5 of 8
Luisfmts
in reply to: Arnsteinh

If LCase(ThisApplication.ActiveColorScheme.Name) Like "millennium" Then
	ThisApplication.ColorSchemes("Presentation").Activate
Else
	ThisApplication.ColorSchemes("Millennium").Activate
End If

 🤗

Message 6 of 8
WCrihfield
in reply to: Arnsteinh

The code I had is similar to @Luisfmts 's code but doesn't attempt to compare only lowercase version of color scheme name.  If neither of those two named color schemes was active, it uses the Else portion to set a default.  I was going between two different schemes before, so I changed the names here.

Dim oCSchemes As ColorSchemes = ThisApplication.ColorSchemes
If ThisApplication.ActiveColorScheme Is oCSchemes("Millennium") Then
	oCSchemes("Presentation").Activate
ElseIf ThisApplication.ActiveColorScheme Is oCSchemes("Presentation") Then
	oCSchemes("Millennium").Activate
Else 'set the default, for when neither color scheme was active
	oCSchemes("Millennium").Activate
End If

 

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 :light_bulb:or you can Explore My CONTRIBUTIONS

Wesley Crihfield

EESignature

Message 7 of 8
Luisfmts
in reply to: WCrihfield

Hi @WCrihfield,

Yeah, it is just my old habits comparing strings without case sensitivity 😅
Message 8 of 8
WCrihfield
in reply to: Luisfmts

Hi @Luisfmts .  I'm honestly not sure if these names are case sensitive or not, but the practice of comparing strings at same case setting is definitely a good practice to get in the habit of, and is often overlooked. 🙂👍

Wesley Crihfield

EESignature

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

Post to forums