Lippens Infra Posted October 21, 2020 Share Posted October 21, 2020 Hello, I have a lot of drawings comming from an export f.e. Tekla stuctures. Those drawings have no layer structure, only thing to categorize entities are the colors. Is it possible to create layers per color and get the entities in that layer? Thanks in advance 1A - Fundering.dwg Quote Link to comment Share on other sites More sharing options...
Tharwat Posted October 21, 2020 Share Posted October 21, 2020 Give this a shot and let me know. (defun c:M2LC (/ int sel get clr lay) ;; Tharwat - 21.10.2020 ;; ;; Move 2 Layer Color. ;; (and (setq int -1 sel (ssget "_:L" '((0 . "~VIEWPORT"))) ) (while (setq int (1+ int) ent (ssname sel int) ) (setq get (entget ent) clr (cdr (assoc 62 get)) lay (itoa clr) ) (and clr (or (tblsearch "LAYER" lay) (entmake (list '(0 . "LAYER") '(100 . "AcDbSymbolTableRecord") '(100 . "AcDbLayerTableRecord") (cons 2 lay) (cons 62 clr) '(70 . 0) ) ) ) ) (entmod (append get (list (cons 8 lay) '(62 . 256)))) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.