How to UnCheck the option of 'display layout background' by lisp?

How to UnCheck the option of 'display layout background' by lisp?

swaywood
Collaborator Collaborator
452 Views
2 Replies
Message 1 of 3

How to UnCheck the option of 'display layout background' by lisp?

swaywood
Collaborator
Collaborator

usualy we done this by the option/display/layout element/the toogle option 'display layout background'

now i want to set it by lisp, is there any system value to set this? or some other method to check it.

0 Likes
Accepted solutions (2)
453 Views
2 Replies
Replies (2)
Message 2 of 3

dbroad
Mentor
Mentor
Accepted solution
;;to get the display preferences object
(setq dpref (vla-get-display
	      (vla-get-preferences
		(vlax-get-acad-object)))
      )

;;to get the current setting of the paper space background
(vla-get-layoutdisplaypaper dpref)

;;to turn the background on
(vla-put-layoutdisplaypaper dpref :vlax-true)
;;to turn the background off
(vla-put-layoutdisplaypaper dpref :vlax-false)
;;to update the layout display
(vla-regen (vla-get-activedocument
	     (vlax-get-acad-object))
  acAllViewports)
Architect, Registered NC, VA, SC, & GA.
Message 3 of 3

m_badran
Advocate
Advocate
Accepted solution

There is no system value, but you can do it with lisp.

 

(vl-load-com)
(setq acadObj (vlax-get-acad-object))
(setq preferences (vla-get-Preferences acadObj))
(vla-put-LayoutDisplayPaper (vla-get-Display preferences) :vlax-true);you can change to false
(setq thisdrawing 
       (vla-get-activedocument 
               (vlax-get-acad-object)))
(vla-Regen thisdrawing acAllViewports)