Jump to content

Recommended Posts

Posted

Is their any lisp or routine, which will apply psltscale as 0 from 2 and then regionall(rea) in all layout at time, so linetype will be visible in every viewport 

Posted

Where I am we have a holiday today, and so CAD is off for me, however, I do wonder what an internet search would give you?

 

Something like 

(setvar 'psltscale 2)

 

should set the psltscale to 2

 

Something like this:

(foreach l (layoutlist)

... Your Code ....

)

 

will scroll through the layouts

 

And finally a simple internet search will give this:

 

 

Posted
2 hours ago, smitaranjan said:

Is their any lisp or routine, which will apply psltscale as 0 from 2 and then regionall(rea) in all layout at time, so linetype will be visible in every viewport 

(defun c:foo nil
  (setvar 'cmdecho 0)
  (foreach l (layoutlist) (setvar 'ctab l) (setvar 'psltscale 0) (command "_.regenall"))
  (setvar 'cmdecho 1)
  (princ)
)

 

  • Like 1
  • Thanks 1
Posted
1 hour ago, ronjonp said:
(defun c:foo nil
  (setvar 'cmdecho 0)
  (foreach l (layoutlist) (setvar 'ctab l) (setvar 'psltscale 0) (command "_.regenall"))
  (setvar 'cmdecho 1)
  (princ)
)

 

 

 

ronjon, you have just copied from ronjon in my link!!

Posted (edited)
12 minutes ago, Steven P said:

 

 

ronjon, you have just copied from ronjon in my link!!

HAHAHA .. I did not even go to the link. 🤣

 

Well .. it's a little bit different with the cmdecho and regenall.

Edited by ronjonp
  • Like 1
Posted

A small example on lisp how it is possible to automatically (with the help of reactors) change the values of system variables when switching the Sheet Model

taken from the website https://forum.dwg.ru/showthread.php?t=29281

 

;;;The IRON command turns on the reactor
;;;The LR OFF command turns off the reactor
;;;If you need to activate the reactor
;;;immediately after downloading the file
;;;Uncomment (delete ;) the last line
;;;
(vl-load-com)
(defun ChangeLayout (reactor layout)
;;; In model Space LTSCALE =0.5xDIMSCALE
;;; In the model , the value LTSCALE = 0.5xDIMSCALE
;;; In layout space LTSCALE=0.5 PSLTSCALE=1
;;; In the layout LTSCALE=0.5 PSLTSCALE=1
  (if (= (nth 0 layout) "Model")
;;;ModeL Space 
    (setvar "ltscale"
            (* (if (= (getvar "dimscale") 0)
                 1
               ) ;_ end of if
               (getvar "dimscale")
            ) ;_ end of *
            0.5
    ) ;_ end of setvar
    (progn
;;;Layout tab 
           (setvar "ltscale" 0.5)
           (setvar "psltscale" 1)
    ) ;_ end of progn
  )
) ;_ end of defun
(defun LayoutReactorOn ()
;;;Turning on the reactor
;;; Challenge - (LayoutReactorOn)
  (if
    (not *LayoutReactor*)
     (setq *LayoutReactor*
            (vlr-miscellaneous-reactor
              nil
              '((:vlr-layoutswitched . ChangeLayout))
            ) ;_ end of VLR-Miscellaneous-Reactor
     ) ;_ end of setq
  ) ;_ end of if
  (if *LayoutReactor*
    (princ "\n*LayoutReactor* ON")
    (princ "\n*LayoutReactor* Exist")
  ) ;_ end of if
  (princ)
) ;_ end of defun
(defun LayoutReactorOff ()
;;;Reactor shutdown call (LayoutReactorOff)
  (and *LayoutReactor*
       (vlr-added-p *LayoutReactor*)
       (vlr-remove *LayoutReactor*)
       (setq *LayoutReactor* nil)
  ) ;_ end of and
  (princ "\n*LayoutReactor* OFF")
  (princ)
) ;_ end of defun
(defun C:LRON () (LayoutReactorOn))
(defun C:LROFF () (LayoutReactorOff))
(princ)
;(LayoutReactorOn)

 

Posted

for correct display of dotted and center lines on sheets and when printing
(for sheet scales other than 1)
(if (= (getvar 'PSLTSCALE) 1) (setvar 'PSLTSCALE 0) )

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...