BIGAL Posted 1 hour ago Posted 1 hour ago (edited) In another post there was questions about changing Mline styles for existing Mlines. So answered that and thought what about adding fillets to a mline. Wel as we know you can not do that, so did it this way. Converting the individual mlines to plines then filleting the plines produced. The fillet radius changing matching the offsets. ; Convert mline to plines and add a rdius. ; By AlanH Aug 2026 (defun LWPoly (lst cls) (entmakex (append (list (cons 0 "LWPOLYLINE") (cons 100 "AcDbEntity") (cons 100 "AcDbPolyline") (cons 90 (length lst)) (cons 70 cls)) (mapcar (function (lambda (p) (cons 10 p))) lst))) ) (defun c:ml2plrad ( / oldsnap pt1 pt2 ent obj obj2 co-ords dict col lst x) (setq oldsnap (getvar 'osmode)) (setvar 'osmode 0) (setq pt1 (getpoint "\nPick 1st point for drag ")) (setq pt2 (getpoint pt1 "\nPick 2nd point ")) (setq pts (list pt1 pt2)) (setq ent (ssname (ssget "F" pts (list (cons 0 "Mline"))) 0)) (setq obj (vlax-ename->vla-object ent)) (setq styleName (vla-get-StyleName obj)) (setq lay (vlax-get obj 'layer)) (setvar 'clayer lay) (setq co-ords (vlax-get obj 'coordinates)) (vla-delete obj) (setq pts2 '() x 0) (repeat (/ (length co-ords) 3) (setq pts2 (cons (list (nth x co-ords)(nth (1+ x) co-ords)) pts2)) (setq x (+ x 3)) ) (setq dict (dictsearch (cdr (assoc -1 (dictsearch (namedobjdict) "ACAD_MLINESTYLE"))) styleName)) (setq offsets (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 49)) dict))) (setq col (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 62)) dict))) (setq col (cdr col)) ; ignore 1st color (setq lst '() x 0) (repeat (length col) (setq lst (cons (list (nth x offsets)(nth x col)) lst)) (setq x (1+ x)) ) (LWPoly pts2 0) (setvar 'filletrad (getreal "\nEnter Fillet radius for most outside offset ")) (command "fillet" "P" (entlast)) (setq x 1) (repeat (- (length col) 1) (setq obj2 (vlax-ename->vla-object (entlast))) (vlax-put obj2 'color (nth (1- x) col)) (vla-offset (vlax-ename->vla-object (entlast)) (- (nth x offsets)(nth (1- x) offsets))) (setq x (1+ x)) ) (setq obj2 (vlax-ename->vla-object (entlast))) (vlax-put obj2 'color (nth (1- x) col)) (setvar 'osmode oldsnap) (princ) ) (c:ml2plrad) Edited 1 hour ago by BIGAL Added image 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.