- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
HI
I dose anyone have a LISP program there can convert polyline-circle to normal circle.
I do have 10 different polyline-circles in my drawing, and a lot of them.
I looked up at code, there can do the job for one polyline-circle, but I need it be able
selecting all, and then convert them to normal circles.
This is the code I looked up.
(defun c:Test (/ ss)
;; Author : Tharwat 20. jan. 2014 ;;
(if (setq ss (ssget "_:L" '((0 . "LWPOLYLINE") (-4 . "&=") (70 . 1))))
((lambda (i / sn l x y)
(while (setq sn (ssname ss (setq i (1+ i))))
(setq l (mapcar 'cdr (vl-remove-if-not (function (lambda (u) (eq (car u) 10))) (entget sn)))
x (/ (apply '+ (mapcar 'car l)) (length l))
y (/ (apply '+ (mapcar 'cadr l)) (length l))
)
(if (entmakex (list '(0 . "CIRCLE") (cons 10 (list x y)) (cons 40 (distance (list x y) (car l)))))
(entdel sn)
)
(setq l nil
x nil
y nil
)
)
)
-1
)
)
(princ)
)
(vl-load-com)
Regards
Henrik
Solved! Go to Solution.