Author Topic: Changing numerous blocks (40 or so) to another layer at once  (Read 3532 times)

0 Members and 1 Guest are viewing this topic.

TJAM51

  • Guest
Changing numerous blocks (40 or so) to another layer at once
« Reply #15 on: June 24, 2005, 01:24:13 PM »
That is strange...this routine you added works great.....who can figure.....thanks

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Changing numerous blocks (40 or so) to another layer at once
« Reply #16 on: June 24, 2005, 01:36:54 PM »
Code: [Select]
(DEFUN C:GENERAL (/ ss)

  (command "LAYER" "M" "E-LITG" "C" "30" "" "")
  (command "LAYER" "M" "E-LITA" "C" "30" "" "")

  (if
    (setq ss
  (ssget "x"
 '(
   (-4 . "<OR")
   (2 . "TYPE_110")
   (2 . "TYPE_122")
   (2 . "type_120")
   (-4 . "OR>")
  )
  )
    )
     (progn
       (setq cntr 0)
       (while (setq ent (ssname ss cntr))

(setq entlst (entget ent))
(setq entlst
(subst
 (cons 8 "0") ; change layer name here
 (assoc 8 entlst)
 entlst
)
)
(entmod entlst)

(setq cntr (1+ cntr))
       )
     )
  )

  (PRINC)
)
TheSwamp.org  (serving the CAD community since 2003)