NKK Posted December 21, 2021 Share Posted December 21, 2021 I am working on a Master planning project which has around 500 plots, now I want to chamfer the edge of all my plot and most my my combination contains of an Arc and a line, see attached images for sample. Can anyone please help me ! Quote Link to comment Share on other sites More sharing options...
kirby Posted December 21, 2021 Share Posted December 21, 2021 (edited) Should the chamfer distance along the arc be an arc length or a tangent (e.g. straight line) length? How about polylines, are the line and arc segments part of a polyline or just simple line and arc segments? Edited December 21, 2021 by kirby added clarification Quote Link to comment Share on other sites More sharing options...
mhupp Posted December 21, 2021 Share Posted December 21, 2021 This lisp basically does what you want. https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/chamfer-2-0/td-p/10822529 (defun c:chd (/ spm dc ss s1 s2 pins c pc1 pc2) (vl-load-com) (setq spm (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object)))) (setq dc (getreal "\nEnter Chamfer distance: ")) (setq ss (ssget)) (if (= (sslength ss) 2) (progn (setq s1 (vlax-ename->vla-object (ssname ss 0))) (setq s2 (vlax-ename->vla-object (ssname ss 1))) (setq pin (vla-intersectwith s1 s2 acextendnone)) (setq cc (vla-addcircle spm pin dc)) (setq pc1 (vla-intersectwith cc s1 acextendnone)) (setq pc2 (vla-intersectwith cc s2 acextendnone)) (vla-erase cc) (vla-addline spm pc1 pc2) (setq line (entlast)) ;trim from line ? ) (prompt "\nOnly pick two objects") ) ) 1 Quote Link to comment Share on other sites More sharing options...
NKK Posted December 21, 2021 Author Share Posted December 21, 2021 Hi, kirby, 1. Length along the Arc to be Tangent length . 2. They are part of Lines but also sometimes Polylines. Thanks. Quote Link to comment Share on other sites More sharing options...
NKK Posted December 21, 2021 Author Share Posted December 21, 2021 Hi mhupp, Thanks for the LISP, but it doesn't trim the edges after the Chamfer has been created and also it doesn't remember the last chamfer unit inserted, so I have to insert the number each time I run the command and also can you make it work for Pline aswell. Thanks. Quote Link to comment Share on other sites More sharing options...
mhupp Posted December 21, 2021 Share Posted December 21, 2021 (edited) 2 hours ago, NKK said: it doesn't trim the edges after the Chamfer has been created and also it doesn't remember the last chamfer unit inserted Yeah couldn't figure out how to trim in time. will remember last input defaults to 5 the first time. (defun c:chd (/ spm dia ss s1 s2 cen cir pc1 pc2 line) (vl-load-com) (setq spm (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object)))) (setq dia (vlax-ldata-get "cir" "dia")) ;checks for ldata and sets the variable (if (= dia nil) (setq dia "5")) ;first time running it will default to value 5 (if (= "" (setq a (getstring (strcat "\nIngresa Dia [" dia "]: ")))) (setq a dia) ;if you hit enter it will set a to dia value else override it to what you input ) (vlax-ldata-put "cir" "dia" a) ;Saves value to drawing (setq ss (ssget)) (if (= (sslength ss) 2) (progn (setq s1 (vlax-ename->vla-object (ssname ss 0)) s2 (vlax-ename->vla-object (ssname ss 1)) cen (vlax-safearray->list(vlax-variant-value (vla-intersectwith s1 s2 acextendnone))) cir (vla-addcircle spm cen dia) pc1 (vla-intersectwith cir s1 acextendnone) pc2 (vla-intersectwith cir s2 acextendnone) ) (vla-erase cir) (setq line (vla-addline spm pc1 pc2)) (command "_.Trim" line "") (command (list (ssname SS 1) cen)) (command (list (ssname SS 0) cen)) (command "") ) (prompt "\nOnly pick two objects") ) (princ) ) Edited December 21, 2021 by mhupp Quote Link to comment Share on other sites More sharing options...
NKK Posted December 21, 2021 Author Share Posted December 21, 2021 Thanks, it is showing error when chamfering ARC with line, it's working fine when Arc is drawn as a Polyline. Quote Link to comment Share on other sites More sharing options...
mhupp Posted December 21, 2021 Share Posted December 21, 2021 17 minutes ago, NKK said: Thanks, it is showing error when chamfering ARC with line, it's working fine when Arc is drawn as a Polyline. Can you share what the error says? Are they connected/touching like your example? everything working over here. 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.