Author Topic: update ACAD registry in current session  (Read 7416 times)

0 Members and 1 Guest are viewing this topic.

snownut2

  • Swamp Rat
  • Posts: 971
  • Bricscad 22 Ultimate
Re: update ACAD registry in current session
« Reply #15 on: July 31, 2013, 07:53:42 AM »
I know this is an old thread, I am looking to change model & paperspace background colors witht he same type of function, no luck...

Bruce

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: update ACAD registry in current session
« Reply #16 on: July 31, 2013, 08:36:37 AM »
I know this is an old thread, I am looking to change model & paperspace background colors witht he same type of function, no luck...

Use the ActiveX graphicswinmodelbackgrndcolor & graphicswinlayoutbackgrndcolor properties derived from the Application.Preferences.Display object, e.g.:

Code - Auto/Visual Lisp: [Select]
  1. (defun c:bcolor ( / disp )
  2.     (vla-put-graphicswinmodelbackgrndcolor  disp (LM:rgb->ole 100 0 0))
  3.     (vla-put-graphicswinlayoutbackgrndcolor disp (LM:rgb->ole 0 100 0))
  4.     (princ)
  5. )
  6.  
  7. ;; RGB -> OLE  -  Lee Mac
  8. ;; Args: r,g,b - [int] Red, Green, Blue values
  9.  
  10. (defun LM:RGB->OLE ( r g b )
  11.     (+  (fix r)
  12.         (lsh (fix g) 08)
  13.         (lsh (fix b) 16)
  14.     )
  15. )
  16.  

RGB->OLE function from here.