Help me please,
Anybody know how to fillet selected polylines all at once by lisp.
Solved! Go to Solution.
Solved by Kent1Cooper. Go to Solution.
@Anonymous wrote:
....
Anybody know how to fillet selected polylines all at once by lisp.
In simplest terms [very lightly tested], using whatever the current Fillet radius setting is:
(defun C:FMP ; = Fillet Multiple Polylines (/ plss n) (if (setq plss (ssget "_:L" '((0 . "LWPOLYLINE")))) (repeat (setq n (sslength plss)) (command "_.fillet" "_polyline" (ssname plss (setq n (1- n)))) ); repeat ); if (princ) ); defun
Enhance with the usual stuff as desired, and/or with a request for a radius, allowing "heavy" 2D Polylines, etc.
@muhamed_ragab92 wrote:
Not worked for me cad 2016 , please can you help me
It works for me in Acad2016. Be more specific -- what about it doesn't work? Does it not load? Does it load, but not recognize the command name? Does it recognize the command name, but something happens differently from what you expect, and if so, what? Etc., etc.
Some possible causes: Picking Polylines on locked Layers. Picking "heavy" [whether 3D or 2D] rather than LightWeight Polylines. Picking things that look like Polylines but are really collections of Lines/Arcs, or possibly other kinds of things [e.g. Regions]. Picking sharp-cornered Polylines but not setting a non-zero Fillet radius first. If the current Fillet radius is not zero, picking Polylines that are too small for the current Fillet radius to round their corners.
le agradezco pues mi estimado gracias, trabajare con esto para mis polígonos de manzanas
Hello @Kent1Cooper
Thanks for the routine !
I will do a Micro-Update for PLines Chamfer ...
Regards, Patrice (The Old French EE Froggy)
The Health - Stay Safe
Patrice BRAUD
Hello
Before using the routine FMP from Kent1Cooper,
PLEASE do a "classic" FILLET Command with the RIGHT Radius (for the future FMP) !
Because FMP is using the latest Fillet Radius, so it must be OK !!
The Health, Bye, Patrice
Patrice BRAUD
@rhgrafix wrote:
This doesn't work for me either. I have 10 rectangles, all lwPolylines with zero radii corners, I want to give them all .05" radii on all corners of each rectangle at one time, FMP does nothing ....
@braudpat rightly points out what these from my earlier Messages say:
[Message 2] .... using whatever the current Fillet radius setting is ....
[Message 5] Some possible causes [of its not working for @muhamed_ragab92 in Message 4] .... Picking sharp-cornered Polylines but not setting a non-zero Fillet radius first.
But you don't need to actually Fillet something to establish the desired radius. You can just set the FILLETRAD System Variable before running the command.
If that's not the problem, maybe a drawing file would help. But would you prefer a routine that asks you for a radius every time, rather than using whatever the current radius is? That would be a fairly simple revision.
@Kent1Cooper wrote:
.... would you prefer a routine that asks you for a radius every time, rather than using whatever the current radius is? That would be a fairly simple revision.
Here's a less-than-simple revision, FilletMultiplePolylines.lsp [using the same FMP command name], including error handling, and remembering your radius. See the comments at the top of the file.
It could be done differently in several ways: It could always offer regular Fillet's radius setting as the default, and not store a radius from within the command. It could be wrapped in Undo begin-end, so using U after it will undo all the Filleting it did, collectively. It could report how many selected Polylines it did not Fillet [see reasons in the comments], or it might be possible to filter the selection to not accept those in the first place. Etc.
It doesn't work in any file, someone changed the code to this and now it works:
(defun C:FMP
(/ plss n)
(if (setq plss (ssget '((0 . "LWPOLYLINE"))))
(repeat (setq n (sslength plss))
(command "_.fillet" "_polyline" (ssname plss (setq n (1- n))))
); repeat
); if
(princ)
)
@rhgrafix wrote:
It doesn't work in any file, someone changed the code to this and now it works:
....
Well, that requires further explanation. The only difference between that and the code in Message 2 [which you said in Message 8 didn't work for you, but that works for everyone else] is that the changed version allows selection of Polylines on locked Layers. But it wouldn't be able to Fillet those anyway, so that should make no difference in the end result.
Maybe what requires explanation is exactly what you meant by "FMP does nothing" in Message 8. Does it not load? Does it load, but not recognize the command name? Does it recognize the command name, but does not allow you to select anything? [If so, is it because they're all on locked Layers?] Does it allow selection, but nothing about the selected Polylines changes? Are there any messages? Run it so that it "does nothing," and post the command-line history.
@paliwal222 wrote:
....
Does it is possible,
If each corner of the intersection was a Polyline that turned the corner, FMP would round all the corners. But because of the different colors, that is clearly not the case. It is a completely different operation, so I suggest starting a new Topic. But when you do, post a small drawing file showing before and after, and a more detailed explanation. [In particular, it's not clear to me what you mean by the "break at midpoint" note. Should the Arc at the corner be split in the middle, and each half put on the Layer of the Line it connects to? It doesn't look like that in zooming in on the image, but the resolution is not very good.] Never mind -- I see you have done so.
thanks for posting your code! I slightly revised to do the same thing for Chamfer, as someone else did too.
;batch chamfer multiple polylines
;uses pre-defined (default) distances of the chamfer command
(defun C:CMP ; = Chamfer Multiple Polylines
(/ plss n)
(if (setq plss (ssget "_:L" '((0 . "LWPOLYLINE"))))
(repeat (setq n (sslength plss))
(command "_.chamfer" "_polyline" (ssname plss (setq n (1- n))))
); repeat
); if
(princ)
); defun
Is there a way this code can work in reverse? For instance, I am in the aluminum extrusion industry, all our shapes have to have a .016" fillet at all sharp corners, but our quality machine that rides the edges, and works off of a DXF file, doesn't like those fillets in the geometry. I'd like to be able to apply those radii to get the correct weight per foot, or remove them to 90's to save a dxf, but I'd only want it to remove radius of .016". Thanks in advance!
Nevermind! I can use FILLETRAD and set it to 0. As long as I use an ARC or chop a CIRCLE to get my random radii it won't effect those. Awesome code! Thanks!
Can't find what you're looking for? Ask the community or share your knowledge.