Change Color Scheme through iLogic

Change Color Scheme through iLogic

Anonymous
Not applicable
1,540 Views
7 Replies
Message 1 of 8

Change Color Scheme through iLogic

Anonymous
Not applicable

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

Accepted solutions (1)
1,541 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable

Bump

Message 3 of 8

cwhetten
Advisor
Advisor
Accepted solution

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

0 Likes
Message 4 of 8

Anonymous
Not applicable
Many thanks.
0 Likes
Message 5 of 8

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

 🤗

0 Likes
Message 6 of 8

WCrihfield
Mentor
Mentor

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

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 7 of 8

Luisfmts
Enthusiast
Enthusiast
Hi @WCrihfield,

Yeah, it is just my old habits comparing strings without case sensitivity 😅
0 Likes
Message 8 of 8

WCrihfield
Mentor
Mentor

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

(Not an Autodesk Employee)

0 Likes