本帖最后由 Cass生手…… 于 2014-6-24 10:54 编辑
- (defun c:jjgcd(/ cr)
- (setvar "cmdecho" 0)
- (setq cr (/ 3.0 (getvar 'DIMSCALE)))
- (setq k1 (getint "\n[请输入成图比例尺<1:500(1)/1000(2)/2000(3)<默认1:500>>:") )
- (cond ((= k1 1) (setq blc 1.0 d1 0.5))
- ((= k1 2) (setq blc 2.0 d1 1))
- ((= k1 3) (setq blc 4.0 d1 2))
- (t (setq blc 1.0 d1 0.5))
- )
- (setq k1 (getint "\n[请输入高程点小数位]<3>"))
- (cond ((= k1 1) (setq gcws 1))
- ((= k1 2) (setq gcws 2))
- ((= k1 3) (setq gcws 3))
- (t (setq gcws 3))
- )
- (setvar "osmode" 4) ;捕捉圆心
- (setq p1 (getpoint "\n请选择第一个高程点:"))
- (setq ptl '())
- (setq cd 0.000)
- (setq cdl '())
- (setq a3 0.000) (setq i 0)
- (setvar "osmode" 1) ;捕捉端点节点交点最近点
- (setq pt2 p1)
- (while (setq pt (getpoint "\n请按顺序输入内插高程点位置:"))
- (setq ptl (cons pt ptl))
- (setq cd (+ cd (disuser1 pt pt2)))
- (setq pt2 pt)
- (setq cdl (cons cd cdl))
- )
- (setq cdl (reverse cdl))
- (setq ptl (reverse ptl))
- (setvar "osmode" 4) ;捕捉圆心
- (setq p2 (getpoint "\n请选择第二个高程点:"))
- (setq cd (+ cd (disuser1 pt2 p2)))
- (setq a1 (caddr p1))
- (setq a2 (caddr p2))
- (command "layer" "s" "gcd" "" "")
- (while (nth i ptl)
- (setq a3 (+ a1 (* (- a2 a1) (/ (nth i cdl) cd))))
- (command "_insert" "gc200" (list (car (nth i ptl)) (cadr (nth i ptl)) a3) d1 d1 0 );调用块gc200高程点
- (command "text" "s" "hz" "j" "ml" (list (+ (car (nth i ptl)) cr) (cadr (nth i ptl))) blc 0 (rtos a3 2 gcws) );注记高程点
- (setq i (+ i 1))
- )
- (command "layer" "s" "0" "" "")
- (setvar "cmdecho" 1)
- (princ)
- )
这个代码谁能修改一下:
一、能不能选取在选取的两个高程点之间插随机数值的高程,而不是单一的高程。
二、能不能注记成高程点,而不是打散的点和数字。
谢谢大家了,这个代码也是在网上找的。自己对这个方面也不会,所以向大家求助
|