Jump to content
stenna

Change Block layer to Level 0

Recommended Posts

stenna

Morning again,

 

Is there a lisp or piece of code that would change the contents of a block to Layer 0, so I can set it down in my Layering Standard rather than the standard the block was created in (not by me).

 

Look forward to hearing from you

 

Stenna

Share this post


Link to post
Share on other sites
Tharwat

Almost the same like the one that I have posted in your second thread with a little modifications to suit the needs . :)

 

(vl-load-com)
(defun c:2lay0 (/ b o)
 ;;--- Tharwat 26.June.2013 ---;;  
 (or doc (setq doc (vla-get-ActiveDocument (vlax-get-acad-object))))
 (vlax-for b (vla-get-blocks doc)
   (if
     (and
       (eq :vlax-false (vla-get-isLayout b))
       (eq :vlax-false (vla-get-isXref b))
     )
      (vlax-for o b
          (vla-put-layer o "0")
        )
      )
   )
 (vla-regen doc acAllViewports)
 (princ)
)

Share this post


Link to post
Share on other sites

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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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...