Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, Can I get some help with this.
I have this lisp that gets layer, color and linetype from selected object and sets them current.
It works partially. If the selected object has manually changed color and linetype the lisp finds them and sets current correctly. But if the color and linetype are "ByLayer" the lisp doesn't work.
What is wrong with it? I can't get it to work. (Lisp-code is still quite unfamiliar for me)
(defun c:GETPROP ()
(setq obj (car (entsel "\nSelect an object: ")))
(setq ent (entget obj))
;; Extract linetype, layer, and color
(setq linetype (cdr (assoc 6 ent)))
(setq layer (cdr (assoc 8 ent)))
(setq color (cdr (assoc 62 ent)))
;; Set linetype, layer, and color as current
(command "-linetype" "S" linetype "")
(command "CLAYER" layer "")
(command "CECOLOR" color "")
)
(princ)
Solved! Go to Solution.