Jump to content

Change Block layer to Level 0


stenna

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
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
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...