@omarsvn Try this.
Create polygon and separating lines. Run code, select separating lines and pick areas inside main polygon.
AT the and remove original polygon.
(defun c:boundaryByPickPoint (/ *error* p adoc i eo ss sm)
(defun *error* ()
(setvar 'cmdecho 1)
(setvar 'osmode old)
(if (not (member msg '("Function cancelled" "quit / exit abort")))
(princ)
)
(princ)
)
(setq
i -1
adoc (vla-get-activedocument (vlax-get-acad-object))
old (getvar 'osmode)
)
(princ "\nSelect dividing lines!")
(setq ss (ssget '((0 . "*line"))) lst (entlast) sm (ssadd))
(while (< (setq i (1+ i)) (sslength ss))
(setq eo (vlax-ename->vla-object (ssname ss i)))
(vla-offset eo 0.0675)
(ssadd (entlast)sm )
(vla-offset eo -0.0675)
(ssadd(entlast) sm )
)
(princ "\nPress <Enter> to exit loop!")
(vla-endundomark adoc)
(vla-startundomark adoc)
(setvar 'cmdecho 0)
(setvar 'osmode 0)
(setq i 0)
(while (setq p (getpoint (strcat " \nPick " (itoa (setq i (1+ i))) ". point >")))
(command "._boundary" p "")
)
(setq i -1)
(while (< (setq i (1+ i)) (sslength ss))
(entdel (ssname ss i))
)
(setq i -1)
(while (< (setq i (1+ i)) (sslength sm))
(entdel (ssname sm i))
)
(setvar 'osmode old)
(setvar 'cmdecho 1)
(vla-endundomark adoc)
(princ "\nDone!")
(princ)
)
Miljenko Hatlak
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.