BrianTFC Posted January 30, 2012 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
alanjt Posted January 30, 2012 Posted January 30, 2012 Is your stated version (2000i) an older LT version? Is it LISP capable? Quote
alanjt Posted January 30, 2012 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
BrianTFC Posted January 30, 2012 Author Posted January 30, 2012 Thanks that is exactly what i was looking for... Quote
Ahankhah Posted January 31, 2012 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
Lee Mac Posted January 31, 2012 Posted January 31, 2012 Be careful when 'entlast' is an Attribute Block or Polyline. Quote
Ahankhah Posted February 1, 2012 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
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.