BrianTFC Posted January 30, 2012 Share Posted January 30, 2012 Hi All Does any one have a Lisp routine to turn the diagonal line that chamfer creates to the current layer instead of the original layer of the lines? I would appreciate any help. Thanks Brian Quote Link to comment Share on other sites More sharing options...
alanjt Posted January 30, 2012 Share Posted January 30, 2012 Is your stated version (2000i) an older LT version? Is it LISP capable? Quote Link to comment Share on other sites More sharing options...
BrianTFC Posted January 30, 2012 Author Share Posted January 30, 2012 We use 2000i and 2012 Quote Link to comment Share on other sites More sharing options...
alanjt Posted January 30, 2012 Share Posted January 30, 2012 (defun c:Chamfer2 (/ ent) (setq ent (entlast)) (command "_.chamfer") (while (eq (logand 1 (getvar 'CMDACTIVE)) 1) (command PAUSE)) (if (not (equal ent (setq ent (entlast)))) (entmod (list (cons 8 (getvar 'CLAYER)) (cons -1 ent))) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
BrianTFC Posted January 30, 2012 Author Share Posted January 30, 2012 Thanks that is exactly what i was looking for... Quote Link to comment Share on other sites More sharing options...
alanjt Posted January 30, 2012 Share Posted January 30, 2012 You're welcome. Quote Link to comment Share on other sites More sharing options...
Ahankhah Posted January 31, 2012 Share Posted January 31, 2012 But when chamfering a Polyline object while Trimmode variable is set to zero, there may be more than one object as the result of CHAMFER. For this case alanjt's nice code can be edited to: (defun c:Chamfer2 (/ ent) (setq ent (entlast)) (command "_.chamfer") (while (eq (logand 1 (getvar 'CMDACTIVE)) 1) (command PAUSE)) [b][color=purple](while (setq ent (entnext ent)) [/color][/b](entmod (list (cons 8 (getvar 'CLAYER)) (cons -1 ent))) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 31, 2012 Share Posted January 31, 2012 Be careful when 'entlast' is an Attribute Block or Polyline. Quote Link to comment Share on other sites More sharing options...
Ahankhah Posted February 1, 2012 Share Posted February 1, 2012 Be careful when 'entlast' is an Attribute Block or Polyline. I checked Polyline and it doesn't cause any error on VERTEX and SEQUEND objects, but changes ATTRIB objects. So the code can be edited to this one: (defun c:Chamfer2 (/ ent) (setq ent (entlast)) (command "_.chamfer") (while (eq (logand 1 (getvar 'CMDACTIVE)) 1) (command PAUSE)) (while (setq ent (entnext ent)) (or (member (cdr (assoc 0 (entget ent))) '("ATTRIB" "VERTEX" "SEQUEND")) (entmod (list (cons 8 (getvar 'CLAYER)) (cons -1 ent))) ) ) (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.