本帖最后由 snddd2000 于 2013-1-18 13:08 编辑
- (defun get-pline-point (ent / ptlist ptlist1)
- (setq ptlist '() ptlist1 '() n 0)
- (setq ptlist (vlax-safearray->list
- (vlax-variant-value
- (vlax-get-property
- (vlax-ename->vla-object ent)
- 'Coordinates
- )
- )
- )
- )
- (cond
- (
- (= "LWPOLYLINE" (cdr (assoc 0 (entget ent)
- )
- )
- )
- (progn
- (repeat (/ (length ptlist) 2)
- (setq ptlist1 (cons (list (nth n ptlist)
- (nth (setq n (1+ n)) ptlist)
- )
- ptlist1)
- )
- (setq n (1+ n))
- )
- )
- )
- (
- (= "POLYLINE" (cdr (assoc 0 (entget ent)
- )
- )
- )
- (progn
- (repeat (/ (length ptlist) 3)
- (setq ptlist1 (cons (list (nth n ptlist)
- (nth (setq n (1+ n)) ptlist)
- (nth (setq n (1+ n)) ptlist)
- )
- ptlist1)
- )
- (setq n (1+ n))
- )
- )
- )
- )
-
- (princ (reverse ptlist1))
- (princ)
- )
- (defun C:tt1()
- (setq ent nil)
- (while
- (= ent nil)
- (setq ent (ssget "_:S:E" (list
- (cons 0 "LWPOLYLINE,POLYLINE")
- )
- )
- )
- )
- (setq ent (ssname ent 0))
- (get-pline-point ent)
- )
|