Ricko Posted July 30, 2021 Posted July 30, 2021 I am looking for a Lisp Routine that will select the Raster Image in my Drawing and place it on Layer 0. I have tried different approaches but am unable to figure it out. Can anyone help? Thanks. Quote
BIGAL Posted August 2, 2021 Posted August 2, 2021 (edited) Unable to figure it out Why not on layer "Image", have a look at (setq ss (ssget "X" '((0 . "IMAGE")))) you can then either entmod (assoc 8 or use (vla-put-layer I dont use often maybe even (setpropertyvalue ent "layer" "IMAGE") Edited August 2, 2021 by BIGAL 1 Quote
Ricko Posted August 2, 2021 Author Posted August 2, 2021 I understand your first code statement of (setq ss (ssget "X" '((0. "IMAGE")))) but not sure about he rest. When the fist statement creates the list how would I separate out just the IMAGE entity from that list and use it within the Command "Change". Basically what I want to do is this, (command "change" Image "" "p" "la" "0" "") - using the list to call out the IMAGE through properties then layer and assigning it to layer 0. This is what I would like it to do. Quote
ronjonp Posted August 2, 2021 Posted August 2, 2021 8 hours ago, Ricko said: I understand your first code statement of (setq ss (ssget "X" '((0. "IMAGE")))) but not sure about he rest. When the fist statement creates the list how would I separate out just the IMAGE entity from that list and use it within the Command "Change". Basically what I want to do is this, (command "change" Image "" "p" "la" "0" "") - using the list to call out the IMAGE through properties then layer and assigning it to layer 0. This is what I would like it to do. Try this .. will put all images in the drawing on layer 0 ( unless on a locked layer ) (defun c:foo (/ s) (if (setq s (ssget "_X" '((0 . "IMAGE")))) (foreach e (mapcar 'cadr (ssnamex s)) (entmod (append (entget e) '((8 . "0"))))) ) (princ) ) Quote
BIGAL Posted August 2, 2021 Posted August 2, 2021 Nice Ronjonp old fashioned (command "change" ss "" "p" "la" "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.