Guys,
How can I find the center of a closed polyline shape drawn, as I want to place text there ?
Stephen
|
Guys,
How can I find the center of a closed polyline shape drawn, as I want to place text there ?
Stephen
a simple routine to try .. saves the Centerpoint to he sysvar "LASTPOINT" an creates a circle ..
Code:(defun c:PLCENTER (/ PL RE P) (if(setq PL(car(entsel "\nSELECT PL:"))) (progn (command "_undo" "_m") (command "_region" PL "") (if(and(setq RE(vlax-ename->vla-object (entlast))) (=(strcase(vla-get-objectname RE)) "ACDBREGION") (setq P (vla-get-centroid RE)) (setq P(vlax-safearray->list(vlax-variant-value P))) ) (setvar "LASTPOINT" P) ) (command "_undo" "_b") ) ) (if P (command "_circle" P 5)) )
Thomas,
Your on fire, reply after reply, thanks heaps. I am actually wanting to use it with the area thread as set the location for the text. I will have a play and see how it goes.
Thanks again
Stephen