Dear y'all,
I've been on a quest for the past few day searching for a lisp routine to save time and rework. I've been unsuccessful. I'm updating and redrawing HVAC layouts using POLYLINE with a variety of widths.
I know very little about writing a lisp, so I'm asking for some help. My work around is writing Macros, but this isn' working out.
My idea is to be able to select 3 or more individual POLYLINEs and have them FILLETed with a radius of the same width of the POLYLINE. i.e. 5", 6", 7"...etc.
Solved! Go to Solution.
Solved by Kent1Cooper. Go to Solution.
@jarredmonday wrote:
.... I'm updating and redrawing HVAC layouts using POLYLINE with a variety of widths.
....
My idea is to be able to select 3 or more individual POLYLINEs and have them FILLETed with a radius of the same width of the POLYLINE. i.e. 5", 6", 7"...etc.
Your description suggests that the Polylines already have a width when you start, from which a routine could extract a Fillet radius, but your image looks like they don't. If they don't, would the User be asked to enter the width/radius? Might they need to select ingredients for more than one resulting Polyline at once, and if so, would they all get the same width/radius?
Given answers to those questions, it doesn't look very complicated to build a routine to do the steps involved [PEDIT with the Multiple and Join options and a fuzz factor, followed by FILLET with the Polyline option, would get you to step two, then PEDIT can impost the width].
Thank you for the reply. To answer your questions, the polylines would have a width to them already, but may change thru a user input.The radius of the fillet should reflect the width of the polyline, as well.
"Might they need to select ingredients for more than one resulting Polyline at once, and if so, would they all get the same width/radius?" - I don't fully understand this question...I think you're asking, if the polylines selected are different width, will they result in one equal width? Yes. I assume, regardless of the width of the polylines selected, the user will define the width for the end result.
I hope I didn't stir the pot with confusion.
@jarredmonday wrote:
... "... select ingredients for more than one resulting Polyline at once, and if so, would they all get the same width/radius?" - I don't fully understand this question.... regardless of the width of the polylines selected, the user will define the width for the end result.
....
I meant that if the User selects, say, two groups of Lines [or line-segment Polylines] like those in your image, that are distant enough from each other that the fuzz distance in Pedit won't connect them, it will make two resulting Polylines. If that would not be the case, then this [which Fillets only the "last" object, though it would give width to all] seems to work in limited testing:
(defun C:PJFW ; = Polyline Join with Fillet and Width (/ ss) (initget (if *pjfwradwid 4 5)); no negative [zero OK], no Enter on first use (setq *pjfwradwid (cond ( (getdist (strcat "\nDistance for Polyline Width and corner fillet Radius" (if *pjfwradwid (strcat " <" (rtos *pjfwradwid) ">") "") ": " ); strcat ); getdist ); User-entry condition (*pjfwradwid) ); cond ); setq (setvar 'peditaccept 1); just in case -- save value and reset later if desired (setq ss (ssget ":L" '((0 . "LINE,ARC,LWPOLYLINE")))) (command "_.pedit" "_multiple" ss "" "_join" (* *pjfwradwid 2) "_width" *pjfwradwid "" ;;; don't know whether fuzz distance --^ is a good basis for your use -- plain number instead? "_.fillet" "_radius" *pjfwradwid "_.fillet" "_polyline" "_last" ); command ); defun
It's a little simpler than it could be -- no error handler or system variable save/reset or other assorted controls, it could be made to accept "heavy" 2D Polylines in the selection [but would at the same time need a means to exclude 3D Polylines], you might want to play around with adding a Jointype option in the Pedit command, etc. It could be made more sophisticated to work with multiple Polylines resulting from the selection. But it nicely remembers the width/radius you gave it, and offers it as the default on subsequent use.
I must say, Kent1Cooper, I am lost for words to express how impressed I am.
This is flawless. The fuzz factor is fine where it is and is working as I expected.
Thank you very very much. I hope this can be archived and used to help others for future development. I'll also continue to play around with it.
tray with this :
(defun c:test(/ )
(setq getrad (getint"\n Enter Radius:"))
(setq filr (setvar "FILLETRAD" getrad))
(command "_.pedit" "_multiple" "" pause "width" filr "" "_.fillet" "_polyline" "_last")
(princ)
)
This is nice, but it's missing the part were it can join a number of individual plines, selected, into one single pline, then change the width and fillet.
@jarredmonday wrote:This is nice, but it's missing the part were it can join a number of individual plines, selected, into one single pline, then change the width and fillet.
oops sorry misunderstand.
another way.
mayby this work:
(defun c:test(/ FILR GETRAD SS ) (setq getrad (getdist"\n Enter Dist:")) (setq ss (ssget '((0 . "LINE,ARC,LWPOLYLINE,SPLINE")))) (setq filr (setvar "FILLETRAD" getrad)) (command "_.pedit" "_multiple" ss "" "_join" (* getrad 2) "_width" getrad "" "_.fillet" "_polyline" "_last") (princ) )
HTH
mostafa
@eprime.ec wrote:
You are all wrong, this is the routine you need.
(defun C:FR ()
(command "Filletrad" pause ".fillet")
(princ)
)It will ask you for the radius, get the radius, and begin filleting your lines. I originally came here for advice.
No, we're not, and no, it isn't. That routine completely omits the Polyline-joining aspect of the original question. And it doesn't "begin" filleting your lines, as I would interpret that wording, but lets you do only one Fillet operation, and then ends -- it would need the Multiple option included in it for it to "begin" filleting.
The fillet command automatically has the ability to fillet a polyline, (I do it all the time.) and it brings you the menu, once the radius is entered, that you can do multiple etc.. Again I do it all the time. It works, it's simple. You don't have to reprogram the entire command. Just use a a macro short cut.
If it works for you, I guess that's all you really need.
See you in four years! 😂