Hello All - i have a routine that grabs the entities & changes from an "existing layer" to a "demo layer" ...
Our layer scheeme is simple, AE-* (or AT-* for points) are for existing entities , AD-* is for demolition layers... in our existing condition dwgs i want to "see both the demo & existing entities, but in the site (or proposed dwgs) i freeze said (AD-*)"demo layers"
it works but not on points & surfey figures.
ive tried (entupd) after re- creating the list & subing out the (cons 😎 for desired layer - but cant get it to rebuild
any advice would be greatly appreciated, as i am a hack...
thank you,
chris wallis
civil3d 2014
heres the code i have:
;;;; DEMO1
;; GRABS LAYERS & SWAPS WITH A DEMO LAYER
;; SO AE-FC BECOMES AD-FC
;;
(DEFUN C:DEMO ()
(setq ENT (ssget))
(setq LEN (sslength ENT))
(setq COUNT 0 )
(while
(< count LEN)
(setq INFO (entget (ssname ENT COUNT)))
(progn
(SETQ DALAY (CDR(ASSOC 8 INFO)))
(COND
((= DALAY "AE-PMK")
(setq InFO (subst (cons 8 "AD-PMK")(assoc 8 INFO)INFO))(entmod INFO))
((= DALAY "AE-FC")
(setq InFO (subst (cons 8 "AD-FC")(assoc 8 INFO)INFO))(entmod INFO))
((= DALAY "AT-SIGN")
(setq InFO (subst (cons 8 "AD-SIGN")(assoc 8 INFO)INFO))(entmod INFO))
((= DALAY "AE-BC")
(setq InFO (subst (cons 8 "AD-BC")(assoc 8 INFO)INFO))(entmod INFO))
((= DALAY "AE-SW")
(setq InFO (subst (cons 8 "AD-SW")(assoc 8 INFO)INFO))(entmod INFO))
((= DALAY "AE-WALL")
(setq InFO (subst (cons 8 "AD-WALL")(assoc 8 INFO)INFO))(entmod INFO))
((= DALAY "AT-TREE")
(setq InFO (subst (cons 8 "AD-TREE")(assoc 8 INFO)INFO))(entmod INFO))
((= DALAY "AT-LI")
(setq InFO (subst (cons 8 "AD-LI")(assoc 8 INFO)INFO))(entmod INFO))
) ;;END COND
;;;;;;;;;;;;;(ENTUPD(SSNAME ENT 0))
);; progn
(setq COUNT (1+ COUNT ))
);;while
(princ)
(alert (strcat (rtos count) " changed"))
)
Hi,
Sorry for the late response.
Are those entities from XRef Layer ?
Does it work fine if you use the UI tools to "grabs the entities & changes from an "existing layer" to a "demo layer" ? Did you check that ?
Thanks,
Partha