- (defun getPt(ent n / lstPoints)
- ;提取所有顶点坐标
- (mapcar '(lambda(x) (if (= (car x) 10) (setq lstPoints (append lstPoints (list (cdr x)))))) (entget ent))
- (if (and (> n 0)(< n (length lstPoints)))
-
- (list
- ;第n个顶点
- (nth (- n 1) lstPoints)
-
- ;倒数第n个
- (nth (- (length lstPoints) n) lstPoints)
- )
- (alert "超出多段线的顶点数!")
- )
- )
|