- (defun c:tt ()
- (defun Entmakex-Layer (lname)
- (entmakex (list '(0 . "LAYER")
- '(100 . "AcDbSymbolTableRecord")
- '(100 . "AcDbLayerTableRecord")
- (cons 2 lname)
- )
- )
- (setvar 'clayer lname)
- )
- (defun xyp-get-Color (s1 / co)
- (if (setq co (xyp-DXF 62 s1))
- co
- (cdr (assoc 62 (tblsearch "layer" (xyp-DXF 8 s1))))
- )
- )
- (defun xyp-dxf (code e) (cdr (assoc code (entget e))))
- (setq i -1)
- (if (setq ss (ssget))
- (while (setq s1 (ssname ss (setq i (1+ i))))
- (setq la (itoa (xyp-get-color s1)))
- (Entmakex-Layer la)
- (vla-put-layer (vlax-ename->vla-object s1) la)
- )
- )
- (princ)
- )
|