i wrote below piece of code for labelling elevation to contour(Polyline). it works but it labels at end of contour. what i want is to label in middle of contour with proper aligning text label . can anybody modified it for me..?
sample dwg attached ..........!Code:(defun c:qq() (setq ss (ssget'((0 . "LWPOLYLINE")))) (setq sslngth (sslength ss)) (Setq idx 0) (repeat sslngth (setq ename (ssname ss (setq sslngth (1- sslngth)))) (setq edata (entget ename)) (setq xy (cdr (Assoc 38 edata))) (setq xy1(cdr (Assoc 10 edata))) (setq xx(rtos xy 2 0)) (command "text" xy1 10 30 xx "") ) )