Radus Posted March 31 Posted March 31 Dears, I need change color for all object in a specific layer. I tried this code (Layer name is AXES and color I need set to bylayer), but I still make something wrong. Thanks a lot for helping... (if (setq ss (ssget "_A" (list '(0 . "AXES") (cons 8 (getvar 'CTAB))))) (repeat (setq n (sslength ss)) (setq obj (vlax-ename->vla-object (ssname ss (setq n (1- n))))) (vl-catch-all-error-p (vl-catch-all-apply 'vla-put-Color (list obj acByLayer))) )) Quote
Saxlle Posted March 31 Posted March 31 (edited) Hi @Radus, Try to change (vl-catch-all-error-p (vl-catch-all-apply 'vla-put-Color (list obj acByLayer))) into (vl-catch-all-error-p (vl-catch-all-apply 'vla-put-Color (list obj 256))). The 256 is the "index" for the ByLayer. Edited March 31 by Saxlle Quote
Steven P Posted March 31 Posted March 31 could also try the entmod method where you are changing dxf code 62 to 256. Quote
ronjonp Posted March 31 Posted March 31 Also your DXF group codes are both incorrect: ;; Change this (setq ss (ssget "_A" (list '(0 . "AXES") (cons 8 (getvar 'CTAB))))) ;; To this (setq ss (ssget "_A" (list '(8 . "AXES") (cons 410 (getvar 'CTAB))))) Quote
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.