just needs get the points 'end' coords of all the entities
and then use "" Gile's or Lee.Mac's "" tools!
It's just putting those two together..
LM:ConvexHull strange behavior at:
https://www.theswamp.org/index.php?topic=53116.msg578882#msg578882and Lee.Mac's tool to connect points:
https://www.lee-mac.com/entitytopointlist.html;;-----------------------------------------------------
LEFT THE WHILE SELECT LOOP IN IT..
;;
;; Entity to Point List - Lee Mac
;; Returns a list of WCS points describing or approximating the supplied entity, else nil if the entity is not supported.
;; ent - [ent] Entity name to be described by point list (POINT/LINE/ARC/CIRCLE/LWPOLYLINE/POLYLINE/ELLIPSE/SPLINE)
;; acc - [num] Positive number determining the point density for non-linear objects
(defun LM:ent->pts ( ent acc / ang bul cen cls di1 di2 enx inc itm lst num ocs rad tot typ vt1 vt2 vtl )
(setq enx (entget ent)
typ (cdr (assoc 0 enx))
acc 4.0 ;; number mods circ,arc point amt
)
(cond
( (= "POINT" typ)
(list (cdr (assoc 10 enx)))
)
( (= "LINE" typ)
(mapcar '(lambda ( x ) (cdr (assoc x enx))) '(10 11))
)
( (or (= "ARC" typ) (= "CIRCLE" typ))
(if (= "ARC" typ)
(setq ang (cdr (assoc 50 enx))
tot (rem (+ pi pi (- (cdr (assoc 51 enx)) ang)) (+ pi pi))
num (fix (+ 1.0 1e-8 (* acc (/ tot (+ pi pi)))))
inc (/ tot (float num))
num (1+ num)
)
(setq ang 0.0
tot (+ pi pi)
num (fix (+ 1e-8 acc))
inc (/ tot (float num))
)
)
(setq cen (cdr (assoc 010 enx))
rad (cdr (assoc 040 enx))
ocs (cdr (assoc 210 enx))
)
(repeat num
(setq lst (cons (trans (polar cen ang rad) ocs 0) lst)
ang (+ ang inc)
)
)
(reverse lst)
)
( (or (= "LWPOLYLINE" typ)
(and (= "POLYLINE" typ) (zerop (logand (logior 16 64) (cdr (assoc 70 enx)))))
)
(if (= "LWPOLYLINE" typ)
(setq vtl (LM:ent->pts:lwpolyvertices enx))
(setq vtl (LM:ent->pts:polyvertices ent))
)
(if (setq ocs (cdr (assoc 210 enx))
cls (= 1 (logand 1 (cdr (assoc 70 enx))))
)
(setq vtl (append vtl (list (cons (caar vtl) 0.0))))
)
(while (setq itm (car vtl))
(setq vtl (cdr vtl)
vt1 (car itm)
bul (cdr itm)
lst (cons (trans vt1 ocs 0) lst)
)
(if (and (not (equal 0.0 bul 1e-8)) (setq vt2 (caar vtl)))
(progn
(setq rad (/ (* (distance vt1 vt2) (1+ (* bul bul))) 4.0 bul)
cen (polar vt1 (+ (angle vt1 vt2) (- (/ pi 2.0) (* 2.0 (atan bul)))) rad)
rad (abs rad)
tot (* 4.0 (atan bul))
num (fix (+ 1.0 1e-8 (* acc (/ (abs tot) (+ pi pi)))))
inc (/ tot (float num))
ang (+ (angle cen vt1) inc)
)
(repeat (1- num)
(setq lst (cons (trans (polar cen ang rad) ocs 0) lst)
ang (+ ang inc)
)
)
)
)
)
(reverse (if cls (cdr lst) lst))
)
( (= "ELLIPSE" typ)
(setq di1 (vlax-curve-getdistatparam ent (vlax-curve-getstartparam ent))
di2 (vlax-curve-getdistatparam ent (vlax-curve-getendparam ent))
di2 (- di2 1e-8)
)
(while (< di1 di2)
(setq lst (cons (vlax-curve-getpointatdist ent di1) lst)
rad (distance '(0.0 0.0) (vlax-curve-getfirstderiv ent (vlax-curve-getparamatdist ent di1)))
di1 (+ di1 (/ di2 (1+ (fix (* acc (/ di2 rad (+ pi pi)))))))
)
)
(reverse (if (vlax-curve-isclosed ent) lst (cons (vlax-curve-getendpoint ent) lst)))
)
)
)
(defun LM:ent->pts:lwpolyvertices ( enx / elv lst vtx )
(setq elv (list (cdr (assoc 38 enx))))
(while (setq vtx (assoc 10 enx))
(setq enx (cdr (member vtx enx))
lst (cons (cons (append (cdr vtx) elv) (cdr (assoc 42 enx))) lst)
)
)
(reverse lst)
)
(defun LM:ent->pts:polyvertices ( ent / lst vte vtx )
(setq vte (entnext ent)
vtx (entget vte)
)
(while (= "VERTEX" (cdr (assoc 0 vtx)))
(setq lst (cons (cons (cdr (assoc 10 vtx)) (cdr (assoc 42 vtx))) lst)
vte (entnext vte)
vtx (entget vte)
)
)
(reverse lst)
)
;;// -----------------------------------------------------------------------------------------------------------
(defun os3 ( / dist ename vobj )
(setq dist 0.0000001) ;; puts point close enough to vertex
;(setq ent (car (entsel ent))) ;; "\nSelect object to offset: ")
(setq vobj (vlax-ename->vla-object ent))
(if (vlax-method-applicable-p vobj 'Offset)
(progn
(vlax-invoke vobj 'Offset dist) ; INSIDE
;; (vlax-invoke vobj 'Offset (- dist))
)
(princ "\nCannot offset selected object type ")
)
(princ)
) ;end
;;// -----------------------------------------------------------------------------------------------------------
(defun c:p/ ( / *error* ss ent entx dvn ) ;; ent dvn
(princ " Places Points On Ends/Arcs/Quads <undo or oops to un-erase..>");; and Makes Block < *SELECT* >
(setvar 'cmdecho 0)
(setq tot 0)
(defun *error* ( msg )
(vla-endundomark (vla-get-activedocument (vlax-get-acad-object)))
(if qaf (setvar 'qaflags qaf))
(if msg (prompt msg))
(setvar 'cmdecho 1) ;; (getvar 'cmdecho)
; (setvar "nomutt" 0) ;; <--works to restore var on pre-finish esc/error..
(princ)
)
(while
(setq ss (ssget ":S" '((0 . "LINE,ARC,CIRCLE,SPLINE,LWPOLYLINE"))));;filter selection
(setq ent (ssname ss 0));;grab ename
(setq dvn 4.0) ;; default
(os3) ;; offset dist: -l 136
(setq ent (entlast))
(setq entx ent) ;; make selset with.. to erase
(command)
(foreach pnt (LM:ent->pts ent dvn) ;; 12.0 prefered
(setq ent (entmake (list '(0 . "POINT") (cons 10 pnt))))
)
(setq tot (1+ tot))
(vl-cmdf "erase" entx "")
(princ (strcat " Total: " (rtos tot)))
) ;; end of while loop -l 152
(setvar 'cmdecho 1)
;(princ "\n 'O2B' to Make Block<..anonymous>")
(princ)
)
(vl-load-com) (princ)