下面是本论坛道路中心线采集的程序,想问一下有没有程序可以快速实现获取路网的中心线,路网详见附件
- (defun c:CLZX()
- (prompt "欢迎您用此程序")
- (setvar "cmdecho" 0)
- (command "-layer" "m" "aa" "c" 1 "" "L" "continuous" "" "");创建新层
- (setq oldvar (getvar "OSMODE"))
- (setvar "OSMODE" 512)
- (command "pline")
- (while (= 1 1)
- (setq p1 (getpoint "\n请选择第一个点:"))
- (setq firstX (car p1))
- (setq firstY (cadr p1))
- (setq p2 (getpoint "\n请选择第二个点:"))
- (if p2
- (progn
- (setq secondX (car p2))
- (setq secondY (cadr p2))
- (setq mX (/ (+ firstX secondX) 2))
- (setq mY (/ (+ firstY secondY) 2))
- (setq mX (rtos mX))
- (setq mY (rtos mY))
- (command (strcat mX "," mY))
- )
- (progn
- (command "")
- )
- )
- )
- (setvar "OSMODE" oldvar)
- (princ)
- )
|