Author Topic: Reactor to change AutoCAD background color  (Read 741 times)

0 Members and 1 Guest are viewing this topic.

jlogan02

  • Bull Frog
  • Posts: 327
Reactor to change AutoCAD background color
« on: February 08, 2023, 12:35:21 PM »
Our drawings are live 100% of the time so we differentiate between revisions using color. We've reached the point that I expected, the newest color is either too close to one of our existing standard colors or revision colors, or the color looks great on screen but prints to light to read, or prints great but to dark on the screen.

I need to settle this, so my thought is, have the user set their background color to gray when using that color and back again when done.

I have no experience with reactors but it seems to me I could set the background color when the user pushes the button to the custom color routine for that color. Is there a userclick reactor?

I don't know. Anyone have any ideas?

J.
J. Logan
ACAD 2018

I am one with the Force and the Force is with me.
AutoCAD Map 2018 Windows 10

danAllen

  • Newt
  • Posts: 132
Re: Reactor to change AutoCAD background color
« Reply #1 on: February 08, 2023, 02:48:56 PM »
Why have colors directly translate to printed output? Using CTB or STB you can keep them separate.

If you have a user push a button, then that can run the code to change background color. No need for reactors.

I've thought about creating a reactor to change background for read-only drawings, to avoid my common mistake of opening one that someone else is working on, then forgetting it was RO and editing it. But then I need to have it also track switching tabs to switch color back, and it seemed too complicated.
« Last Edit: February 08, 2023, 02:52:37 PM by danAllen »

BIGAL

  • Swamp Rat
  • Posts: 1398
  • 40 + years of using Autocad
A man who never made a mistake never made anything

baitang36

  • Bull Frog
  • Posts: 213
Re: Reactor to change AutoCAD background color
« Reply #3 on: February 08, 2023, 07:11:31 PM »
Code - Auto/Visual Lisp: [Select]
  1. (defun c:chgsc(/ col DISPLAY)
  2.         (setq    DISPLAY    (vla-get-display
  3.                         (vla-get-preferences
  4.                                 (vla-get-application (vlax-get-acad-object))
  5.                         )
  6.                 )
  7.   )
  8.         (if (= (getenv "Background") "0") (setq col 255) (setq col 0))
  9.         (vla-put-graphicswinlayoutbackgrndcolor DISPLAY (vlax-make-variant
  10.                         (+ col (* col 256)(* col 65536))
  11.                         vlax-vblong
  12.         ))
  13.                         (+ col (* col 256)(* col 65536))
  14.                         vlax-vblong
  15.         ))
  16.         (princ)
  17. )

jlogan02

  • Bull Frog
  • Posts: 327
Re: Reactor to change AutoCAD background color
« Reply #4 on: February 09, 2023, 04:21:17 PM »
Thanks for the replies. Good places to start for sure.
J. Logan
ACAD 2018

I am one with the Force and the Force is with me.
AutoCAD Map 2018 Windows 10