TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: JohnCamper on September 21, 2020, 11:53:27 PM
-
How to select all polylines of certain layer(Eg: "Walls") and fillet them with (0.25) radius .I am just new at this lisp scene so any help would be appreciated.Below is the separate code that selects all elements of layer and another code fillets all selected polylines.How can i combine these two to create a single lisp for certain layer("walls") and (0.25) fillet.
(defun c:SALL ()
(setq TargEnt (car (entsel "\nSelect object on layer to select: ")))
(setq TargLayer (assoc 8 (entget TargEnt)))
(sssetfirst nil (ssget "_X" (list TargLayer)))
(princ)
)
(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
-
For better understanding, and, maybe, get further help, please upload such sample.dwg
As far as I know, ACAD only can edit DWG.
-
(https://ibb.co/6JspW3z)
As in the picture i want all the polylines with layer name "wall" to be filleted with radius 0.25.
-
Are you trying to automatically fillet ALL lwpolylines on the layer or only the selected ones? What CAD are you using on which platform?
-
Yes,I want to fillet ALL lwpolylines on the layer named "wall".The 2nd code that i have put will fillet the selected polylines with previous settings.
I use windows and Autocad 2020.
-
(defun c:Test
( / int sel ent
) (command "_.FILLET" "_Polyline" ent
) )
)
)
-
@Tharwat Thank you for posting but the lisp code that you have posted does the same thing as the lisp code that i have posted above !
I want to Fillet(with radius:0.25) all the polylines under layer "wall" .No need to select the lines.Just run the lisp and it does the thing.
-
Alright, here you go.
(defun c:Test
(/ int sel ent
) )
)
(alert "Layer name <wall> is locked ! unlock then try again" )
)
(list '
(0 .
"LWPOLYLINE") '(8 . "wall")
)
)
)
)
(command "_.FILLET" "_Polyline" ent
) )
)
)
-
Thank you so much @Tharwat.It worked as expected !! :-)
-
Thank you so much @Tharwat.It worked as expected !! :-)
You're welcome anytime.