SLW210 Posted October 10 Posted October 10 https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fillet-multiple-polyline-all-at-once-by-lisp/td-p/6473119 Set the Fillet Radius to 0 Newer AutoCAD can use Multiple option. https://www.autodesk.com/support/technical/article/caas/sfdcarticles/sfdcarticles/FILLET-and-CHAMFER-multiple-sets-of-lines.html Maybe something here works for you. 1 Quote
BIGAL Posted October 10 Posted October 10 Try this written like 30 years ago. ; Fillets multi lines in one go ;By Alan H (defun AH:Fmulti ( / ss fpts num num2 x y) (alert "pick outside-inside-outside") (setq fpts '()) (setq fpts (cons (getpoint "Pick outside")fpts)) (setq fpts (cons (getpoint "Pick inside") fpts)) (setq fpts (cons (getpoint "Pick outside") fpts)) (setq ss (ssget "F" fpts (list (cons 0 "LINE")))) (setq num (sslength ss)) (setq num2 (/ num 2.0)) (if (= (- (fix num2) num2) 0.5) (progn (Alert "you have an odd number of lines please check") (exit) ) ) (setq x 0) (setq y (- num 1)) (setvar "filletrad" 0.0) (repeat (fix num2) ; not a real (setq obj1 (ssname ss x)) (setq obj2 (ssname ss y)) (command "fillet" obj1 obj2) (setq x (+ x 1)) (setq y (- y 1)) ) ) ; defun (AH:fmulti) 1 Quote
Nikon Posted October 11 Posted October 11 (edited) 42 minutes ago, rpsalvi said: i tried this but it is not working Works only with lines. Polylines are not supported. If the AutoCAD version is localized, then (command "_fillet" obj1 obj2) and (setq ss (ssget "_F" fpts (list (cons 0 "LINE")))) ; Fillets multi lines in one go ;By Alan H (defun AH:Fmulti ( / ss fpts num num2 x y) (alert "pick outside-inside-outside") (setq fpts '()) (setq fpts (cons (getpoint "Pick outside")fpts)) (setq fpts (cons (getpoint "Pick inside") fpts)) (setq fpts (cons (getpoint "Pick outside") fpts)) (setq ss (ssget "_F" fpts (list (cons 0 "LINE")))) (setq num (sslength ss)) (setq num2 (/ num 2.0)) (if (= (- (fix num2) num2) 0.5) (progn (Alert "you have an odd number of lines please check") (exit) ) ) (setq x 0) (setq y (- num 1)) (setvar "filletrad" 0.0) (repeat (fix num2) ; not a real (setq obj1 (ssname ss x)) (setq obj2 (ssname ss y)) (command "_fillet" obj1 obj2) (setq x (+ x 1)) (setq y (- y 1)) ) ) ; defun (AH:fmulti1) Edited October 11 by Nikon 1 Quote
EnM4st3r Posted October 11 Posted October 11 (edited) i also tried it, it is working. You just need to adjust it a little to your needs. If your autocad language is not english, you need to add an underscore for the ssget "F" so "_F" and for the filet command. Also you would need to change the ssget filter to use lwpolylines instead of lines and add a pedit command to actually join them after the fillet. Edit: ok its not working with lwpolyline tough i dont get why Edited October 11 by EnM4st3r 1 Quote
pkenewell Posted October 11 Posted October 11 (edited) 12 hours ago, EnM4st3r said: i also tried it, it is working. You just need to adjust it a little to your needs. If your autocad language is not english, you need to add an underscore for the ssget "F" so "_F" and for the filet command. Also you would need to change the ssget filter to use lwpolylines instead of lines and add a pedit command to actually join them after the fillet. Edit: ok its not working with lwpolyline tough i dont get why This has been a long time problem in calling the FILLET command within AutoLISP (Google it - there is allot of forum posts out there). When typing in the FILLET at the command line in AutoCAD, it works with Polylines, but it doesn't work when called inside a (command) statement. As far as I can tell, noone has provided a solution, other than using direct object manipulation (via ENTMOD or with VLA; joining and setting bulges). EDIT: NOTE - it will work for me if the Polylines are 2 separate objects, but if they are already connected into a single object at the corner, it won't work. Edited October 11 by pkenewell 1 Quote
BIGAL Posted October 11 Posted October 11 I will have another look at it using *LINE will detect plines but did find another problem on a certain pattern of linework. Updated. ; Fillets multi lines in one go ;By Alan H (defun AH:Fmulti ( / ss fpts num num2 x y) (alert "pick outside-inside-outside") (setq fpts '()) (setq pt1 (getpoint "Pick outside ")) (setq fpts (cons pt1 fpts)) (setq pt1 (getpoint pt1 "Pick inside ")) (setq fpts (cons pt1 fpts)) (setq fpts (cons (getpoint pt1 "Pick outside ") fpts)) (setq ss (ssget "F" fpts (list (cons 0 "*LINE")))) (princ (sslength ss)) (setq num (sslength ss)) (setq num2 (/ num 2.0)) (if (= (- (fix num2) num2) 0.5) (progn (Alert "you have an odd number of lines please check") (exit) ) ) (setq x 0) (setq y (- num 1)) (setvar "filletrad" 0.0) (repeat (fix num2) ; not a real (setq obj1 (ssname ss x)) (setq obj2 (ssname ss y)) (command "fillet" obj1 obj2) (setq x (+ x 1)) (setq y (- y 1)) ) ) ; defun (AH:fmulti) Will improve a bit more. 1 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.