Hi Everyone
Could anyone help me create a Routine that Toggle XREFs instead of Loading/unloading it or turning the Xrefs Layer On/Off.
I Already have the Reference Manager Toggle Routine.
Thank you in advance.
|
|
|
Hi Everyone
Could anyone help me create a Routine that Toggle XREFs instead of Loading/unloading it or turning the Xrefs Layer On/Off.
I Already have the Reference Manager Toggle Routine.
Thank you in advance.
Last edited by ELIANDEFI; 2021-09-22 at 03:36 PM. Reason: Wrong Text
You can roll your own LISP for this, but have you tried the HIDEOBJECTS Command?
It's basically the reverse of ISOLATEOBJECTS.
To show the hidden objects again, simply use the UNHIDE Command (which is really the UNISOLATEOBJECTS Command).
Another benefit to this, is unlike using LISP to set Visible Property to False, the hidden objects will still appear unhidden automagically after a drawing is saved (with them hidden), closed and reopened.
HTH
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000
I use a routine that freezes or thaws the xref layer(s) (the layers that the xref is on)
I know you mentioned you didn't want that but I use this all the time.
(example of standard NCS-named xref layer)
I also have other layers for different disciplines, like the arch floor plan on an arch xref layer to freeze/thaw separately from other xrefs:Code:;;thaws layer named "G-ANNO-REFR" (defun c:TXR () (command "layer" "thaw" "G-ANNO-REFR""")(princ) ) ;;freezes layer named "G-ANNO-REFR" (defun c:FXR () (command "layer" "thaw" "0" "set" "0" "freeze" "G-ANNO-REFR""")(princ) )
These are basic routines,Code:;;thaws layer named "A-ANNO-REFR" (defun c:TAXR () (command "layer" "thaw" "A-ANNO-REFR""")(princ) ) ;;freezes layer named "A-ANNO-REFR" (defun c:FAXR () (command "layer" "thaw" "0" "set" "0" "freeze" "A-ANNO-REFR""")(princ) )
Just a suggestion.
One of my routines from 2006, see if it can still do the job.
Code:(defun c:layer_xref_on-off ( / a name name_dir name_lay) (setvar "cmdecho" 0) (setq a (tblnext "block" t)) (while a (if (= (logand (cdr (assoc 70 a)) 4) 4) (progn (setq name (cdr (assoc 1 a))) (setq name_dir (strcat (vl-filename-directory name) "\\")) (setq name_lay (strcat (vl-string-right-trim ".dwg" (vl-string-subst "" name_dir name)) "|*")) (command "_.-layer" (if (zerop (getvar "USERI1")) "_off" "_on") name_lay "") ) ) (setq a (tblnext "block")) ) (if (zerop (getvar "USERI1")) (setvar "USERI1" 1) (setvar "USERI1" 0)) (setvar "cmdecho" 1) (princ) )
@Bruno.Valsecchi this routine is exactly what I needed! Thank you so much!
Thank you all for your time!
You are all awesome!