Hi, @tamas.antal.
not sure what happened to that link, but here's the code from Kent:
;;
;; Kent Cooper, 13 June 2013
;;
;; PLineFilletAlong.lsp [command name: PLFA]
;; To draw a PolyLine of zero-width line segments and Fillet the corners along the way.
;; User specifies non-0 Fillet radius [offers current radius as default if non-0].
;; Turns Ortho on for right-angle corners, but can be edited to not do so, and/or
;; User can turn it off or on during routine.
;; Notifies User if any combination of segments cannot be Filleted at current
;; radius, Fillets at 0 radius to join new segment to Pline, then resets radius;
;; check designed for right angles, so may not always work if non-orthogonal.
;; Draws on the current Layer.
;;
;; ------------------------------------------------------------------------------------
;; Lightly edited by Edgar Soares, May 2022
;; ------------------------------------------------------------------------------------
;;
;; Calls out main routine. Uses current filletrad variable if non-zero
(defun C:PLF ( / )
(if (> (getvar 'filletrad) 0) ; if radius is > 0
(pLineFilletAlong 0) ; do not change fillet radius
(pLineFilletAlong 1) ; do change fillet radius
)
)
; Calls out main routine. Asks to change fillet radius (filletrad variable)
(defun C:PLFR ( / )
(pLineFilletAlong 1) ; do change fillet radius
)
; Main Routine: PolyLine, Filleted Along the way
(defun pLineFilletAlong (checkRadius / *error* myFilletRadius filletIt cmde orth myFilletRadiusTemp myPLine new)
(defun *error* (errmsg)
(if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break"))
(prompt (strcat "\nError: " errmsg))
)
(setvar 'orthomode orth) ;; delete or comment out if not desired
(command "_.undo" "_end")
(setvar 'cmdecho cmde)
(princ)
)
(defun myFilletRadius () (getvar 'filletrad))
(defun filletIt ()
(command "_.fillet"
(vlax-curve-getPointAtParam myPLine (- (vlax-curve-getEndParam myPLine) 0.5))
;; midpoint of last Polyline segment
(vlax-curve-getEndPoint new); becomes 'lastpoint for next segment
)
)
(setq
cmde (getvar 'cmdecho)
orth (getvar 'orthomode) ;; delete or comment out if not desired
)
(setvar 'cmdecho 0)
(command "_.undo" "_begin" "_.ortho" "on") ;; delete last two words if not desired
(initget (if (= (myFilletRadius) 0) 7 6)); no 0, no negative, no Enter if FILLETRAD=0
(if (= checkRadius 1)
(checkFilletRadius myFilletRadius)
)
(setq myFilletRadiusTemp (myFilletRadius)); to reset when temporarily set to 0 for too-short segment(s)
(command
"_.pline"
(getpoint
(strcat "\nSpecify start point (r=" (rtos (myFilletRadius)) "):")
)
"_width" 0 0 ; [if allow non-0 width, Fillet selection points may not find Pline]
(getpoint (getvar 'lastpoint) "\nSpecify next point: ")
""
)
(setq myPLine (entlast))
(while (setq pt (getpoint (getvar 'lastpoint) "\nSpecify next point: "))
(command "_.pline" "@" pt "")
(setq new (entlast))
(if
(and
(>=
(- ; last segment length of Polyline
(vlax-curve-getDistAtParam myPLine (vlax-curve-getEndParam myPLine))
(vlax-curve-getDistAtParam myPLine (1- (vlax-curve-getEndParam myPLine)))
); -
(myFilletRadius)
)
(>= (vlax-curve-getDistAtParam new (vlax-curve-getEndParam new)) (myFilletRadius))
;; length of new segment
)
(filletIt); then
(progn
(prompt "\nSegments too short for fillet radius."); else
(setvar 'filletrad 0)
(filletIt)
(setvar 'filletrad myFilletRadiusTemp)
)
)
)
(setvar 'orthomode orth) ;; delete or comment out if not desired
(command "_.undo" "_end")
(setvar 'cmdecho cmde)
(princ)
)
(defun checkFilletRadius (myFilletRadius / )
(setvar 'filletrad
(cond
((getdist
(strcat
"\nSpecify fillet radius"
(if (= (myFilletRadius) 0) "" (strcat " <" (rtos (myFilletRadius)) ">")); current as option only if non-zero
": "
)
)
); User-specified-radius condition
((myFilletRadius)); keep current value on User Enter if non-zero
)
)
)
(vl-load-com)
(princ "\nPLF+ (Polyline Filleted).lsp\n")
(princ)
I reformatted it a bit and changed the calling commands, but otherwise it's his coding altogether (thanks again, Kent!)