mcrei Posted September 1, 2016 Posted September 1, 2016 We use the following code from 2010 user irneb on http://forums.augi.com/showthread.php?44929-Looking-for-a-routine-for-Multiple-Fillet that can fillet multiple parallel lines with an incrementing radius. It works really well, except for the fact that we cannot get it to work on polylines (LWPOLYLINE). Does anyone have any ideas on what we could modify to get this to work with polylines? ;;; 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 (/ 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) pt1 (cadr (cadddr (car (ssnamex ss1 n)))) en2 (ssname ss2 m) pt2 (cadr (cadddr (car (ssnamex ss2 m)))) ) ;_ end of setq (if (and ptlast (= MFillet:Inc "Yes")) (setq rad1 (+ rad1 (GetPerpDist ptlast pt1))) ) ;_ end of if (setvar "FILLETRAD" (+ rad rad1)) (command "_.FILLET" (list en1 pt1) (list en2 pt2)) (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 Quote
BIGAL Posted September 2, 2016 Posted September 2, 2016 I have something similar written written in 1991 way before VL. Doing it now in simple terms the same as Inerb's drag two temporary lines across the plines or lines or combination, use VL Intersectwith to work out the two points that are the new pick points then its just a fillet. You can apply a few different rules, increase at set amount, increase dist based on the spacing of 1 set of lines/plines. Fillet = 0 or fixed. Sorry don't have anything off the shelf some one else may have something. Quote
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.