×
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

background color macro

background color macro

background color macro

(OP)
Is there such a thing as a background color changing macro?

Thanks

Certified SolidWorks Associate
SW2009 X64 SP 5.1
Dell Precision T5500
Nvidia Quadro 4000
Xeon 2.27GHz Quad Core, 6GB RAM
XP Pro X64 SP2.0

RE: background color macro

Try these codes

CODE --> English

Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long

Sub main()

Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc

boolstatus = swApp.SetUserPreferenceIntegerValue(swUserPreferenceIntegerValue_e.swSystemColorsViewportBackground, 12632256)

End Sub 

You can replace the 12632256 value with your required color by converting RGB value to RGB int via this calculator: http://www.shodor.org/stella2java/rgbint.html

Deepak Gupta
CSWE, CSWP, CSDA
SW 2012 SP4.0 & 2013 PR1
Boxer's SolidWorks™ Blog
SolidWorks™ Rendering Contest

RE: background color macro

(OP)
Deepak thanks! Anyway to make it toggle from 2 different values? I could just make 2 different macros if not possible. I toggle from my normal greenish background to white when sending screen shots.

Certified SolidWorks Associate
SW2009 X64 SP 5.1
Dell Precision T5500
Nvidia Quadro 4000
Xeon 2.27GHz Quad Core, 6GB RAM
XP Pro X64 SP2.0

RE: background color macro

(OP)
Scratch that. Can it toggle from my green gradient back ground to a white? While working in Solidworks I use a green or blue gradient background but sometime when I send screen shots I like to have a white background.

Certified SolidWorks Associate
SW2009 X64 SP 5.1
Dell Precision T5500
Nvidia Quadro 4000
Xeon 2.27GHz Quad Core, 6GB RAM
XP Pro X64 SP2.0

RE: background color macro

Try recording a macro while you perform that operation. That is a good method to get a starting point macros in general.

-Dustin
Professional Engineer
Pretty good with SolidWorks

RE: background color macro

(OP)
Got it some how had SW12 libraries checked. Not sure how that happened when I'm on 09. Any ways It changes the color to a green when clicked. Then when clicked again it turns white. But won't change colors when clicked again, stays white.

Certified SolidWorks Associate
SW2009 X64 SP 5.1
Dell Precision T5500
Nvidia Quadro 4000
Xeon 2.27GHz Quad Core, 6GB RAM
XP Pro X64 SP2.0

RE: background color macro

Is a macro really worth worrying about?

The background colour can be changed in two clicks via the Heads Up Toolbar ... Apply Scene > Plain White.

RE: background color macro

(OP)
I was seeing if one was out there looks like Deepak was kind enough to write one. I certainly don't want to take up his time with this. Thanks for the heads up. I normally use the gradient background which doesn't use the back ground colors in a scene. Perhaps I need to switch.

Certified SolidWorks Associate
SW2009 X64 SP 5.1
Dell Precision T5500
Nvidia Quadro 4000
Xeon 2.27GHz Quad Core, 6GB RAM
XP Pro X64 SP2.0

RE: background color macro

@grunt58 I didn't noticed that you had SW2009. I made the macro on SW2012 so that is the reason you're seeing SW2012 libraries. I tested the macro and it was working fine.

Can you simply save one part file with no geometry and attach here. I would to find the error and rectify the macro.

Deepak Gupta
CSWE, CSWP, CSDA
SW 2012 SP4.0 & 2013 PR1
Boxer's SolidWorks™ Blog
SolidWorks™ Rendering Contest

RE: background color macro

You could make a Macro or Hotkey with a Spaceball or Space pilot with Alt keys for accessing tools options and tabbing thru it going to Customize screen and the Colors options is not that difficuly anyway but an icon would be ideal. I don't use macros that much but this would be a cool sample project. I just wish Solidwors could reread registry data in session so the color settings could be changed with a .reg file.

"It's not the size of the Forum that matters, It's the Quality of the Posts"

Michael Cole
Boston, MA
CSWP, CSWI, CSWTS
Follow me on !w¡#$%
@ TrajPar - @ mcSldWrx2008
= ProE = SolidWorks

RE: background color macro

The macro is working fine. Just add swModel.GraphicsRedraw2 after End If for graphic redraw.

The macro should look like

CODE -->

End If

swModel.GraphicsRedraw2

End Sub 

Test and share the results.

Deepak Gupta
CSWE, CSWP, CSDA
SW 2012 SP4.0 & 2013 PR1
Boxer's SolidWorks™ Blog
SolidWorks™ Rendering Contest

RE: background color macro

(OP)
Toggles to white then wont toggle back. I don't want to take up your time making this work. I will just use a scene background and as Cor pointed out it's only a couple clicks to change to white, then back to color. Thanks for your help.

Certified SolidWorks Associate
SW2009 X64 SP 5.1
Dell Precision T5500
Nvidia Quadro 4000
Xeon 2.27GHz Quad Core, 6GB RAM
XP Pro X64 SP2.0

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