×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

How to Change Graphic Window Background?

How to Change Graphic Window Background?

How to Change Graphic Window Background?

(OP)
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!

RE: How to Change Graphic Window Background?

(OP)
Thanks for the help!  Anyone know of an API call for this?

RE: How to Change Graphic Window Background?

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

RE: How to Change Graphic Window Background?

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...
       "If you don't use your head,            
                   your going to have to use your feet."

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources