Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

screen color script

7 REPLIES 7
Reply
Message 1 of 8
tcsteid
1221 Views, 7 Replies

screen color script

In a teaching environment students will find ways to alter system variables making it confusing for the next class that comes into the room. I have students run a script file I created that makes many changes such as cursor size, object snaps off, etc. Is there anything I can add to my script that sets the Uniform Background color and cursor color? I find it helpful to have all screens looking the same for beginning students. I know how to change the colors through Options, but would like to have the settings corrected as soon as they run the script file I give them.

7 REPLIES 7
Message 2 of 8
Patchy
in reply to: tcsteid

The script can be extracted on this page for either black or white background

 

http://forums.augi.com/showthread.php?127442-Changing-background-color-via-Lis

 

Message 3 of 8
3wood
in reply to: tcsteid

Just a brain storm, I haven't tried by myself.

How about set up a standard profile and every time AutoCAD starts from there?

Message 4 of 8
edwin.prakoso
in reply to: tcsteid

I would reset my profile too.

It's easier and would reset everything, make sure you will not miss anything.

If this post solves your problem, please mark it as solved. It will help others with a similar problem to find a solution.

Kind regards,

Edwin Prakoso
LinkedIn | Website | Twitter
Message 5 of 8
tcsteid
in reply to: Patchy

Is there a way to embed the following into a script file so it runs when I run the script? I tried pasting it but it does not work.

defun c:wb () ;;white background

(setq acadobject (vlax-get-acad-object))

(setq acadpref (vlax-get-property acadobject 'preferences))

(setq acaddisp (vlax-get-property acadpref 'display))

(vlax-put-property acaddisp 'GraphicsWinmodelBackgrndColor 16777215)

(vlax-put-property acaddisp 'ModelCrosshairColor 0)

)

Message 6 of 8
tcsteid
in reply to: edwin.prakoso

thank you for responding, but when I create a new profile the color does not change when I start Autocad. What am I missing?

Message 7 of 8
tcsteid
in reply to: tcsteid

I am still trying to find a solution. The students I have take this course as a required course, they will never use Autocad upon completing the course so I want to make it as effortless as possible. On their jobs they will only need to open existing drawings at a workstation in their shop and review drawings. We want them to have a very basic understanding of how Autocad works, they will is a few cases need to edit a drawing or make other minor changes or notes. Some students  will change background colors and it totally confuses others when they come in and the screen is a different color. This is why I created a script to that settings they will never need to know can all be reset with a quick script file. My script just turns off osnaps, grids, sets cursor size and several other settings so the screen always looks the same. I have tried creating a profile, but profiles do not change background or cursor colors. 

Message 8 of 8
dlanorh
in reply to: tcsteid

This is a lisp routine and not a script. It will not work with any AutoCAD LT version.

 

Follow the guide here => http://www.lee-mac.com/runlisp.html

 

At the bottom of this page there is a link to another of Lee's pages on how to load the lisp automatically. It can then be run by typing WB on the command line and pressing enter.

 

I've updated the lisp from post 5 above, to localise the variables and autoload visual lisp. It is also attached as a file.

 

(defun c:wb ( / acadobject acadpref acaddisp) ;;white background
(vl-load-com)
(setq acadobject (vlax-get-acad-object))
(setq acadpref (vlax-get-property acadobject 'preferences))
(setq acaddisp (vlax-get-property acadpref 'display))
(vlax-put-property acaddisp 'GraphicsWinmodelBackgrndColor 16777215)
(vlax-put-property acaddisp 'ModelCrosshairColor 0)
)

 

 

I am not one of the robots you're looking for

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

Post to forums  

Autodesk Design & Make Report

”Boost