Author Topic: "Enhanced" Fillet  (Read 10635 times)

0 Members and 1 Guest are viewing this topic.

Guest

  • Guest
"Enhanced" Fillet
« on: July 03, 2007, 03:44:05 PM »
A while back there was a LSP (I think it was called something along the lines of 'enhanced fillet') that would allow you to fillet two lines like in the attached picture.  Does anyone have a copy of that floating around they could post?

Thanks in advance!

Maverick®

  • Seagull
  • Posts: 14778
Re: "Enhanced" Fillet
« Reply #1 on: July 03, 2007, 03:50:37 PM »
  Like a "Curved Fillet?"

Guest

  • Guest
Re: "Enhanced" Fillet
« Reply #2 on: July 03, 2007, 03:57:13 PM »
Yeah, I think so....but I don't see how SoftPlan is going to help me.  :?

Maverick®

  • Seagull
  • Posts: 14778
Re: "Enhanced" Fillet
« Reply #3 on: July 03, 2007, 03:58:38 PM »
Just checking.

LE

  • Guest
Re: "Enhanced" Fillet
« Reply #4 on: July 03, 2007, 04:09:24 PM »
A while back there was a LSP (I think it was called something along the lines of 'enhanced fillet') that would allow you to fillet two lines like in the attached picture.  Does anyone have a copy of that floating around they could post?

Thanks in advance!

Matt;

I remember seeing that routine and I think I wrote something similar, but cannot find it in here....

For now, maybe you can set the option in the fillet command to No Trim, and select your fillet radius and just trim the portion(s) you don't want....

Adesu

  • Guest
Re: "Enhanced" Fillet
« Reply #5 on: July 03, 2007, 09:50:12 PM »
Hi Matt,
test this code
Code: [Select]
(defun c:test (/ ep pt1 pt2 rad sp ss1 ss2 sse ssx)
  (setq ss1 (entsel "\nSelect a line vertical"))
  (setq pt1 (cadr ss1))
  (setq ss2 (entsel "\nSelect a line horizontal"))
  (setq pt2 (cadr ss2))
  (setq ssx (car ss2))
  (setq sse (entget ssx))
  (setq sp (cdr (assoc 10 sse)))
  (setq ep (cdr (assoc 11 sse)))
  (if
    (and pt1 pt2)
    (progn
      (setq rad 2)
      (command "_fillet" "r" rad "_fillet" pt1 pt2)
      (command "_erase" ssx "")
      ) ; progn
    )   ; if
  (command "_line" sp ep "")
  (princ)
  )


Guest

  • Guest
Re: "Enhanced" Fillet
« Reply #6 on: July 05, 2007, 08:17:29 AM »
Thanks, I'll take a look.

t-bear

  • Guest
Re: "Enhanced" Fillet
« Reply #7 on: July 05, 2007, 03:07:58 PM »
I can see this as a handy little routine with some polishing.  It needs to allow for input of a radius and then return to the old radius when the proggy ends.  Unfortunatly, I'm no coder....just an interested observer.  Let me know what you end up with Matt............ :whistle: :angel:

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: "Enhanced" Fillet
« Reply #8 on: July 09, 2007, 08:46:02 AM »
Here is a start, quick and dirty.
Code: [Select]
(defun c:efillet (/ e1 e2 elst rad)
  (if
    (and
      (or (not (zerop (getvar "filletrad")))
           (prompt "\nRadius must be > 0."))
      (setq e1 (entsel "\nSelect line to fillet"))
      (setq e2 (entsel "\nSelect line to keep"))
      (setq elst (entget (car e2)))
      (not (command "_fillet" e1 e2))
      (equal (assoc 0 (entget (entlast))) '(0 . "ARC"))
    )
     (entmod elst)
  )
  (princ)
)

<edit: added error message>
« Last Edit: July 09, 2007, 08:54:23 AM by CAB »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

A_LOTA_NOTA

  • Guest
Re: "Enhanced" Fillet
« Reply #9 on: July 09, 2007, 11:57:38 AM »
Made a few changes.... still needs work!
Code: [Select]
(defun c:efillet (/ e1 e2 elst OldRad Entz)
  (if (not (zerop (getvar "filletrad")))
    (progn
      (while (not e1)
(initget 1 "Radius")
(setq e1 (entsel "Select first object or [Radius]:"))
(if (or (= e1 "Radius") (= e1 "R"))
  (progn
    (setq OldRad (rtos (getvar "filletrad")))
    (setq NewRad (getreal (strcat "\nSpecify fillet radius < " OldRad " > : ")))
    (if (/= NewRad nil)
      (setvar "filletrad" NewRad)
      )
    (setq e1 nil)
    )
  )
)
      (setq Entz (car e1))
      (redraw Entz 3)
      (while (not e2)
(setq e2 (entsel "\nSelect line to keep"))
)
      (setq elst (entget (car e2)))
      (not (command "_fillet" e1 e2))
      (equal (assoc 0 (entget (entlast))) '(0 . "ARC"))
      (entmod elst)
      )
    (progn
      (prompt "\nRadius must be > 0.")
      )
    )
  (princ)
  )

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: "Enhanced" Fillet
« Reply #10 on: July 09, 2007, 12:06:04 PM »
Welcome to TheSwamp. :-)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

A_LOTA_NOTA

  • Guest
Re: "Enhanced" Fillet
« Reply #11 on: July 09, 2007, 12:24:01 PM »
Thanks! Hope you don't mind me adding to your code! I'm learning & figured I could post some code & someone would tell me the correct way to program!

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: "Enhanced" Fillet
« Reply #12 on: July 09, 2007, 01:06:25 PM »
That's what we are here for. :-)

Here is another version.
Code: [Select]
;;  CAB 07.09.07
(defun c:efillet1 (/ e1 e2 elst rad)
  (defun set_radius (/ NewRad)
    (if
      (and
        (not (initget 6))
        (setq NewRad (getdist (strcat "\nSpecify fillet radius < "
                                      (rtos (getvar "filletrad"))
                                      " > : ")))
      )
       (setvar "filletrad" NewRad)
    )
    nil
  )

  (if (zerop (getvar "filletrad"))
    (set_radius)
  )

  (while
    (progn
      (initget "Radius")
      (setq e1 (entsel "\nSelect line to fillet or [Radius]:"))
      (if (= e1 "Radius")
        (set_radius)
      )
      (/= (type e1) 'list)
    )
  )
  (while (not (setq e2 (entsel "\nSelect line to keep"))))
  (setq elst (entget (car e2)))
  (command "_fillet" e1 e2)
  (if (> (getvar "CMDACTIVE") 0)
    (progn
      (command)
      (princ "\nCannot fillet between these two entities.")
    )
    (if (equal (assoc 0 (entget (entlast))) '(0 . "ARC"))
      (entmod elst)
    )
  )
  (princ)
)

<edit: changed initget from 7 to 6>
« Last Edit: July 09, 2007, 01:46:02 PM by CAB »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

A_LOTA_NOTA

  • Guest
Re: "Enhanced" Fillet
« Reply #13 on: July 09, 2007, 01:37:39 PM »
I like this one! But if I pick the "Radius" option then don't want to change it so I just press "enter" it doesn't like it!

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: "Enhanced" Fillet
« Reply #14 on: July 09, 2007, 01:47:39 PM »
Oops :?
I fixed it in the code above by changing initget from 7 to 6.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.