smitaranjan Posted May 1, 2023 Posted May 1, 2023 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 Quote
Steven P Posted May 1, 2023 Posted May 1, 2023 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: Quote
ronjonp Posted May 1, 2023 Posted May 1, 2023 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) ) 1 1 Quote
Steven P Posted May 1, 2023 Posted May 1, 2023 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!! Quote
ronjonp Posted May 1, 2023 Posted May 1, 2023 (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 May 1, 2023 by ronjonp 1 Quote
Nikon Posted May 2, 2023 Posted May 2, 2023 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) Quote
Nikon Posted May 2, 2023 Posted May 2, 2023 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) ) Quote
Recommended Posts
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.