Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Change Graphic Window Background?

Status
Not open for further replies.

moleary

Computer
Mar 23, 2005
38
Does anyone know how to change the background color of the graphics window? By default it is a blue to white gradient. Is there an API call for this also? Thanks for any help!
 
Replies continue below

Recommended for you

Thanks for the help! Anyone know of an API call for this?
 
To toggle between gradient colour on or off the API Call is
swColorsGradientPartBackground

For Viewport Background the API Call is
swSystemColorsViewportBackground

For Top Gradient Color it is:
swSystemColorsTopGradientColor

For bottom color:
swSystemColorsBottomGradientColor

Hope this helps

regards

vik

 
Here's a very simple macro I use to change (toggle) the backgound color (non-gradient) quickly when I save new library features, etc. I hate how the colored backgound appears when I use the design library but also despise working with a white background.

' ****************************************
' Viewport Background Toggle.swb
' ****************************************

Dim swApp As Object
Dim swDoc As Object

Dim nCurrentColor As Long

Sub main()

Set swApp = Application.SldWorks
Set swDoc = swApp.ActiveDoc

nCurrentColor = swApp.GetUserPreferenceIntegerValue(swSystemColorsViewportBackground)
'swApp.SendMsgToUser (nCurrentColor)
If nCurrentColor = 16777215 Then
swApp.SetUserPreferenceIntegerValue swSystemColorsViewportBackground, 14155261
Else
swApp.SetUserPreferenceIntegerValue swSystemColorsViewportBackground, 16777215
End If

swDoc.GraphicsRedraw2

End Sub

A simple modification can be made to the above in order to use the gradient feature.

Remember...
[navy]"If you don't use your head,[/navy] [idea]
[navy]your going to have to use your feet."[/navy]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor