Fillet multi lines

Fillet multi lines

muhamed_ragab92
Enthusiast Enthusiast
18,914 Views
25 Replies
Message 1 of 26

Fillet multi lines

muhamed_ragab92
Enthusiast
Enthusiast
Please i want lisp or code source to fillet some line with fixed radius ? Anyone can tell me about that
0 Likes
Accepted solutions (1)
18,915 Views
25 Replies
Replies (25)
Message 21 of 26

john.uhden
Mentor
Mentor

I had thought that the FILLET command required (ename pt) as in (entsel) but in recent testing in 2002, I found it required just the points.

 

Good work, Kent, as usual.

John F. Uhden

0 Likes
Message 22 of 26

jtm2020hyo
Collaborator
Collaborator

for me just work for one polyline.

 

what I did bad? (attached file)

 

;;; Helper function to get the point from pt1 perp to entity picked at point pt2
(defun GetPerpPoint (pt1 pt2 /)
  (setvar "LASTPOINT" pt1)
  (osnap pt2 "_perp")
) ;_ end of defun

;;; Helper function to get the distance from pt1 perp to entity picked at point pt2
(defun GetPerpDist (pt1 pt2 /)
  (distance pt1 (GetPerpPoint pt1 pt2))
) ;_ end of defun

(setq MFillet:Inc "No") ;Remember increment fillet

;;; Fillet multiple lines by selecting with fences
(defun c:MFillet_v2 (/ ss1 ss2 n m en1 en2 pt1 pt2 ptlast rad rad1 cmd)
  (setq cmd (getvar "CMDECHO")) ;Get value of CMDECHO
  (setvar "CMDECHO" 0) ;Don't show prompts on command line
  (command "_.UNDO" "_BEgin")
  (setq rad (getvar "FILLETRAD")) ;Get the normal fillet radius
  (while (/= (type pt1) 'List)
    (princ (strcat "\nCurrent settings: Raduis = "
                   (rtos rad)
                   ", Increment Fillet = "
                   MFillet:Inc
                   "\n"
           ) ;_ end of strcat
    ) ;_ end of princ
    (initget "Radius Increment") ;Setup for keywords
    (setq pt1 (getpoint "Select by fence-line 1st set of entities [Radius/Increment]: ")) ;Get 1st point
    (cond
      ((and (= pt1 "Radius")
            (setq rad1 (getDist (strcat "New Radius <" (rtos rad) ">: ")))
       ) ;_ end of and
       (setq rad rad1)
      )
      ((= pt1 "Increment")
       (initget "Yes No")
       (if (setq rad1 (getkword (strcat "Do you want to increment the radius? [Yes/No] <" MFillet:Inc ">: ")))
         (setq MFillet:Inc rad1)
       ) ;_ end of if
      )
    ) ;_ end of cond
  ) ;_ end of while
  (setq pt2 (getpoint pt1 "2nd point of fence-line: ")
        ss1 (ssget "F" (list pt1 pt2))
  ) ;_ end of setq
  (setq pt1 (getpoint "Select by fence-line 2nd set of entities: ")
        pt2 (getpoint pt1 "2nd point of fence-line: ")
        ss2 (ssget "F" (list pt1 pt2))
  ) ;_ end of setq
  (setq n    0
        m    0
        rad1 0.0 ;Initialize the radius to add
  ) ;_ end of setq
  (while (and ss1 ss2 (< n (sslength ss1)) (< m (sslength ss2)))
    (setq en1 (ssname ss1 n)
          ;deleted;pt1 (cadr (cadddr (car (ssnamex ss1 n))));deleted;
		            pt1 (cdr (assoc 10 (entget en1)));new
          en2 (ssname ss2 m)
          ;deleted;pt2 (cadr (cadddr (car (ssnamex ss2 m))));deleted;
		  pt2 (cdr (assoc 10 (entget en2)));new
    ) ;_ end of setq
    (if (and ptlast (= MFillet:Inc "Yes"))
      (setq rad1 (+ rad1 (GetPerpDist ptlast pt1)))
    ) ;_ end of if
    (setvar "FILLETRAD" (+ rad rad1))
    ;deleted;(command "_.FILLET" (list en1 pt1) (list en2 pt2));deleted
	(command "_.FILLET" pt1 pt2);new
    (setq n (1+ n)
          m (1+ m)
          ptlast pt1
    ) ;_ end of setq
  ) ;_ end of while
  (setvar "FILLETRAD" rad) ;Restore previous radius
  (command "_.UNDO" "_End")
  (setvar "CMDECHO" cmd) ;Restore prompts on command line
  (princ)
) ;_ end of defun
0 Likes
Message 23 of 26

jtm2020hyo
Collaborator
Collaborator

share the final version please.

0 Likes
Message 24 of 26

Sea-Haven
Mentor
Mentor

What was wrong with these answers https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/extend-trim-selected-lines/td-p/9258...

 

If you want something else ask in other post ?

Message 25 of 26

jtm2020hyo
Collaborator
Collaborator

I need to work with both


their lisp have more options but just work with lines and allow me to do 2 lines with 4 points no consecutive


your lisp works with lines and polylines but just allow me to do 2 consecutive lines with 3 points consecutive and is harder and I found some errors.

0 Likes
Message 26 of 26

Sea-Haven
Mentor
Mentor

Post true examples in dwg that did not work.

0 Likes