支持,发一个CASS两高程点中间内插高程的源码- (defun c:gcjz ()
- (setvar "osmode" 4)
- (command "setpara" "")
- (while(setq P1 (getpoint "\n 选择第一个点:"))
- (setq z1 (caddr p1))
- (while(if (= 0 z1) (setq P1 (getpoint "\n 所选高程点为0,请重新选择第一个点:")))
- (setq z1 (caddr p1))
- (= 0 z1)
- )
- (setq y1 (car p1))
- (setq x1 (cadr p1))
- (setq z1 (caddr p1))
- (setq P2 (getpoint "\n 选择第二个点:"))
- (setq z2 (caddr p2))
- (while(if (= 0 z2) (setq P2 (getpoint "\n 所选高程点为0,请重新选择第二个点:"))
- (if(= z1 z2) (setq P2 (getpoint "\n 所选高程点与第一点重合,请重新选择第二个点:"))))
- (setq z2 (caddr p2))
- (= 0 z2)
- )
- (setq y2 (car p2))
- (setq x2 (cadr p2))
- (setq z2 (caddr p2))0
- (setq y ( + y1 (/ (- y2 y1) 2)))
- (setq x ( + x1 (/ (- x2 x1) 2)))
- (setq z ( + z1 (/ (- z2 z1) 2)))
- (setq p (list y x z))
- (command "dd" "202101" 1 p z)
- (command)
- )
- )
|