I'm wanting to create a way to quickly change the layers of a CADworx object.
This is what I have so far but its not working like I want. The problem is no matter how many objects I select, it only changes the first then stops working completely. If I try to run it again and select another object it wont do anything. I need to be able to select objects manually.
Can someone point me in the right direction?
(defun C:ttt ()
(setq STL_SS nil)
(graphscr)
(setq STL_SS (ssget '((0 . "LINE")(8 . "CL_Steel"))));;;FIND ALL THE LINES ON LAYER CL-STEEL
(setq CL_CNT 0)
(if (/= STL_SS nil)
(repeat (sslength STL_SS)
(setq STL_NAME (ssname STL_SS CL_CNT))
(setvar "pickstyle" 0)
(command "chprop" STL_NAME "" "LA" "BEAM_CL" "")
(setq CL_CNT (1+ CL_CNT))
);;;repeat
);;;if
(setq STL_SS nil)
(setq STL_SS (ssget "L" '((0 . "3DSOLID")(8 . "STEEL"))));;;FIND ALL THE SOLIDS ON LAYER STEEL
(setq CL_CNT 0)
(if (/= STL_SS nil)
(repeat (sslength STL_SS)
(setq STL_NAME (ssname STL_SS CL_CNT))
(command "chprop" STL_NAME "" "LA" "BEAM" "")
(setq CL_CNT (1+ CL_CNT))
);;;repeat
);;;if
(setvar "pickstyle" 1)
(princ)
)