Author Topic: Reverse Fillet  (Read 2827 times)

0 Members and 1 Guest are viewing this topic.

GDF

  • Water Moccasin
  • Posts: 2081
Reverse Fillet
« on: March 14, 2016, 11:19:53 AM »
I'm trying to do a reverse fillet... This is where I am now with the routine. I would like to know how replace the pause to make the routine automatic.

Code - Auto/Visual Lisp: [Select]
  1. (defun ARCH:FILLET  (RAD / ent1 ent2)
  2.   ;;(ARCH:F_S-VAR)
  3.   (setq ent1 (entget
  4.               (car (entsel "\n* Match Layer of Select Entities to Fillet w/ Radius *"))))
  5.   (setq ent2 (entget
  6.               (car (entsel "\n* Pick second line *"))))
  7.   (setvar "clayer" (cdr (assoc '8 ent1)))
  8.   (setvar "Filletrad" RAD)
  9.   (command "fillet" (cdar ent1)(cdar ent2))
  10.   ;;(while (> (getvar "CMDACTIVE") 0) (command pause))
  11.   (princ "\n* Resetting Fillet Radius to \"Zero\" *")  
  12.   (setq pnt1 (cdr (assoc 11 ent1)))
  13.   (setq pnt2 (cdr (assoc 11 ent2)))
  14.   (command "mirror" (entlast) "" pnt1 pnt2 "y")
  15.   (command "rotate" (entlast) "" pause)
  16.   ;;(ARCH:F_R-VAR)
  17.   (princ))
  18.  
  19.  
  20. (ARCH:FILLET 24)
« Last Edit: March 14, 2016, 02:09:58 PM by John Kaul (Se7en) »
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Reverse Fillet
« Reply #1 on: March 14, 2016, 01:39:33 PM »
Maybe this will work.
Code: [Select]
(defun ARCH:FILLET  (RAD / ent ent1 ent2)
  ;;(ARCH:F_S-VAR)
  (setq ent1 (entget
              (car (entsel "\n* Match Layer of Select Entities to Fillet w/ Radius *"))))
  (setq ent2 (entget
              (car (entsel "\n* Pick second line *"))))
  (setvar "clayer" (cdr (assoc '8 ent1)))
  (setvar "Filletrad" RAD)
  (command "fillet" (cdar ent1)(cdar ent2))
  ;;(while (> (getvar "CMDACTIVE") 0) (command pause))
  (princ "\n* Resetting Fillet Radius to \"Zero\" *")
  (setq ent (entlast))
    (setq   lst   (entget ent)
          cen   (cdr (assoc 10 lst))        ; center point
          rad   (cdr (assoc 40 lst))        ; radius
          ang1  (cdr (assoc 50 lst))        ; start angle
          ang2  (cdr (assoc 51 lst))        ; end angle
          inc   (- ang1 ang2)               ; included angle
          inc   (if (minusp inc) (- inc) (- (* pi 2.0) inc)) ; included angle correction
          p1    (polar cen ang1 rad)        ; start point
          p2    (polar cen ang2 rad)        ; end point
            )

  (command "rotate" ent "" (polar p1 (angle p1 p2) (/ (distance p1 p2) 2.)) "180")
  ;;(ARCH:F_R-VAR)
  (princ))


(ARCH:FILLET 24)
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.

GDF

  • Water Moccasin
  • Posts: 2081
Re: Reverse Fillet
« Reply #2 on: March 14, 2016, 02:01:22 PM »
Perfect Alan

Thanks
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Reverse Fillet
« Reply #3 on: March 14, 2016, 02:03:35 PM »
Glad to help.
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.

ScottMC

  • Newt
  • Posts: 192
Re: Reverse Fillet
« Reply #4 on: November 20, 2019, 08:27:44 PM »
Little past closing but still it would help me again to show me how to solve this one. How do I get this ARC to convert to a PLINE, with the direction CCW? Seems one my clocks are definitely going backwards...