Jump to content

Recommended Posts

Posted

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)))
   ))
  

 

Posted (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 by Saxlle
Posted

could also try the entmod method where you are changing dxf code 62 to 256.

Posted

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)))))

 

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...