本帖最后由 brainstorm 于 2012-5-28 21:00 编辑
用天正的标高检查就可以了 确认一个基准标高 然后检查一下 就都自动更正了
或者按下面
- (defun c:test (/ ss->vlalst ss ele newele)
- (defun ss->vlalst (ss / l i)
- (repeat (setq i (sslength ss))
- (setq
- l (cons (vlax-ename->vla-object (ssname ss (setq i (1- i))))
- l
- )
- )
- )
- )
- (setq ele (getreal "\n输入增减的数值:"))
- (setq ss (ssget '((0 . "TCH_ELEVATION"))))
- (setq sslst (ss->vlalst ss))
- (foreach n sslst
- (progn
- (if (equal
- (setq
- newele
- (rtos (+ ele (atof (vlax-get-property n 'text))) 2 3)
- )
- "0.000"
- )
- (setq newele "%%p0.000")
- )
- (vlax-put-property
- n
- 'text
- newele
- )
- )
- )
- (princ)
- )
|