Jump to content

Recommended Posts

Posted

I am looking for a way to redefine a mass selection of different blocks to a specified layer and color. They are drawings from another company, so I don't want to explode or take the time to redefine all the blocks to a new layer and color ( most are set to "0" and "white") I've merged layers down to my new layer, but I can't merge 0 to the new layer. Some blocks do have blocks nested inside of them. I don't know if anyone has a LISP that would help.

 

Thanks

Posted

This is a slight alteration of the LISP from my last thread - see if it works for you :)

 

The layers in the drawing are listed in the "laylist" at the top of the program - you may need to modify this to suit your drawing layer template.

 

Also, I have set the Layer Colour to "by layer" - this can be changed if need be. :P

 

; bloclay, created by Lee McDonnell October 2008

(defun c:bloclay (/ laylist ss)
   (setvar "cmdecho" 0)
   (setq laylist '("0" "1" "2" "3" "4" "5" "6" "7" "8" "9")
   ) ; end setq
   (foreach n laylist
       (if 
           (setq ss 
               (ssget "X" 
                   (list 
                       (cons 0 "INSERT")
                       (cons 410 (getvar "ctab"))
                       (cons 8 n)
                   ) ; end list
               ) ; end ssget
           ) ; end setq
           (progn
               (princ "\nType Layer to be moved to: ")
               (command "_.chprop"
                   ss ""
                   "LA"
                   pause
                   "C"
                   "bylayer"
                   ""
               ) ; end property change
           ) ; end progn
       ) ; end if
   ) ; end foreach
   (setvar "cmdecho" 1)
   (prompt "\nFunction Complete.")
   (princ)
) ; end program

 

Hope this helps! :)

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