johnshar123xx Posted November 30, 2009 Share Posted November 30, 2009 Tough Questions - Fillet Lisp AutoCAD 2007 I have a quite a few tough questions/requests and I am currently looking for some lisps to solve them. I have been doing some searching online to find the lisps I need, and although I have been able to find some stuff, I still have some things that I can't seem to find exactly what I am looking for. I would like to take the opportunity ahead of time to thank every who views my questions and for any help that is given. Wondering if anyone has a lisp that will allow me to fillet a straight line or polyline connected to an arc Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted December 1, 2009 Share Posted December 1, 2009 Fillet to what radius? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted December 1, 2009 Share Posted December 1, 2009 This? (defun c:fil (/ *error* e1 e2 vl ov) (vl-load-com) (defun *error* (e) (and ov (mapcar 'setvar vl ov)) (or (wcmatch (strcase e) "*BREAK,*CANCEL*,*EXIT*") (princ (strcat "\n** Error: " e " **"))) (princ)) (while (progn (setq e1 (car (entsel "\nSelect First Object: "))) (cond ( (eq 'ENAME (type e1)) (if (vl-position (cdr (assoc 0 (entget e1))) '("LINE" "LWPOLYLINE" "ARC")) (while (progn (setq e2 (car (entsel "\nSelect Second Object: "))) (cond ( (eq 'ENAME (type e2)) (if (not (vl-position (cdr (assoc 0 (entget e2))) '("LINE" "LWPOLYLINE" "ARC"))) (princ "\n** Object must be Line/Polyline/Arc **")))))) (princ "\n** Object must be Line/Polyline/Arc **")))))) (setq vl '("CMDECHO" "OSMODE" "FILLETRAD") ov (mapcar 'getvar vl)) (mapcar 'setvar vl '(0 0 0.0)) (vl-cmdf "_.fillet" e1 e2) (mapcar 'setvar vl ov) (princ)) Quote Link to comment Share on other sites More sharing options...
alanjt Posted December 1, 2009 Share Posted December 1, 2009 This? (defun c:fil (/ *error* e1 e2 vl ov) (vl-load-com) (defun *error* (e) (and ov (mapcar 'setvar vl ov)) (or (wcmatch (strcase e) "*BREAK,*CANCEL*,*EXIT*") (princ (strcat "\n** Error: " e " **"))) (princ)) (while (progn (setq e1 (car (entsel "\nSelect First Object: "))) (cond ( (eq 'ENAME (type e1)) (if (vl-position (cdr (assoc 0 (entget e1))) '("LINE" "LWPOLYLINE" "ARC")) (while (progn (setq e2 (car (entsel "\nSelect Second Object: "))) (cond ( (eq 'ENAME (type e2)) (if (not (vl-position (cdr (assoc 0 (entget e2))) '("LINE" "LWPOLYLINE" "ARC"))) (princ "\n** Object must be Line/Polyline/Arc **")))))) (princ "\n** Object must be Line/Polyline/Arc **")))))) (setq vl '("CMDECHO" "OSMODE" "FILLETRAD") ov (mapcar 'getvar vl)) (mapcar 'setvar vl '(0 0 0.0)) (vl-cmdf "_.fillet" e1 e2) (mapcar 'setvar vl ov) (princ)) While, I feel this is completely unnecessary and still won't worth with plines, I wanted to point out one thing about your selection. Fillet will work when just fed 2 enames, but will give mixed results. Always feed it the '(ename point). Nothing against you Lee, I just wanted to to be aware. (defun c:fil (/ *error* e1 e2 vl ov) (vl-load-com) (defun *error* (e) (and ov (mapcar 'setvar vl ov)) (or (wcmatch (strcase e) "*BREAK,*CANCEL*,*EXIT*") (princ (strcat "\n** Error: " e " **"))) (princ)) (while (progn (setq e1 (entsel "\nSelect First Object: ")) (cond ( (eq 'ENAME (type (car e1))) (if (vl-position (cdr (assoc 0 (entget (car e1)))) '("LINE" "LWPOLYLINE" "ARC")) (while (progn (setq e2 (entsel "\nSelect Second Object: ")) (cond ( (eq 'ENAME (type (car e2))) (if (not (vl-position (cdr (assoc 0 (entget (car e2)))) '("LINE" "LWPOLYLINE" "ARC"))) (princ "\n** Object must be Line/Polyline/Arc **")))))) (princ "\n** Object must be Line/Polyline/Arc **")))))) (setq vl '("CMDECHO" "OSMODE" "FILLETRAD") ov (mapcar 'getvar vl)) (mapcar 'setvar vl '(0 0 0.0)) (vl-cmdf "_.fillet" e1 e2) (mapcar 'setvar vl ov) (princ)) Just trim, using everything as a cutting edge. Then you only have to select the 2 lines. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted December 1, 2009 Share Posted December 1, 2009 Thanks Alan for the advice, appreciated. I realise the LISP is rather simple for this meagre task.. perhaps this was all that was necessary: (defun c:fil ( ) (command "_.fillet" pause pause) (princ)) But at that point, why bother. Quote Link to comment Share on other sites More sharing options...
alanjt Posted December 1, 2009 Share Posted December 1, 2009 Thanks Alan for the advice, appreciated. I realise the LISP is rather simple for this meagre task.. perhaps this was all that was necessary: (defun c:fil ( ) (command "_.fillet" pause pause) (princ)) But at that point, why bother. Exactly, why bother. :wink: Command: F FILLET Current settings: Mode = TRIM, Radius = 0.00 Select first object or [undo/Polyline/Radius/Trim/Multiple]: Select second object or shift-select to apply corner: I'm just picking at you Lee. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted December 1, 2009 Share Posted December 1, 2009 I'm just picking at you Lee. I'll return the favour as always Quote Link to comment Share on other sites More sharing options...
alanjt Posted December 1, 2009 Share Posted December 1, 2009 I'll return the favour as always Oh, I'm sure of it. Quote Link to comment Share on other sites More sharing options...
johnshar123xx Posted December 2, 2009 Author Share Posted December 2, 2009 Hey guys, thank you for taking the time to view my questions and for helping me out with answers to them. I was unable to get these lisps to work. I have attached a dwg file with some examples. I realize it may not be exactly a fillet, but more a fillet type effect. Maybe it can't be done. But I thank you again for your efforts. Fillets.dwg Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted December 2, 2009 Share Posted December 2, 2009 Its due to the fact that the LISP's supplied fillet with zero radius, as we were not sure of the radius you required. Quote Link to comment Share on other sites More sharing options...
johnshar123xx Posted December 2, 2009 Author Share Posted December 2, 2009 Sorry about that, I was hoping it would have reacted like the stock fillet command where it would ask you for a radius and kick back "the radius is too large" if the radius entered is too large. Not sure if it is possible. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted December 2, 2009 Share Posted December 2, 2009 Testing whether the fillet radius is correct for the curves in question makes the code a lot more complex, but if you have a fixed fillet radius, the code is relatively easy. 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.