Jump to content

Tough Questions - Fillet Lisp


johnshar123xx

Recommended Posts

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

Link to comment
Share on other sites

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))

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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. :geek:

Link to comment
Share on other sites

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. :geek:

 

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...