Jump to content

Recommended Posts

Posted

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.

Posted (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 by BIGAL
  • Like 1
Posted

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.

 

 

Posted
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)
)

 

Posted

Nice Ronjonp

 

old fashioned (command "change" ss "" "p" "la" "0" "")

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...