本帖最后由 作者 于 2004-12-25 19:50:03 编辑
- ;;多义线顶点坐标
- (defun c:test010 (/ ss i ssn retcoord n pt)
- (setvar "cmdecho" 0)
- (princ "\n选取PLINE多义线...")
- (setq ss (ssget '((0 . "*POLYLINE"))))
- (setq i 0)
- (setvar "pdmode" 33)
- (repeat (sslength ss)
- (princ (strcat "\n第" (rtos (+ i 1) 2 0) "条线数据 : "))
- (princ)
- (setq ssn (ssname ss i))
- (setq retcoord (vla-get-Coordinates (vlax-ename->vla-object ssn)))
- (setq n 0)
- (repeat
- (length (vlax-safearray->list (vlax-variant-value retcoord))
- )
- (setq pt
- (vlax-safearray-get-element (vlax-variant-value retcoord) n)
- )
- (princ "\n")
- (princ pt)
- (setq n (1+ n))
- )
- (princ)
- (princ "\n ")
- (princ)
- (setq i (+ 1 i))
- )
- (princ)
- )
|