发布于:2007-04-26 08:33:26
来自:电气工程/天正电气
[复制转发]
(defun c:dm02()
(setvar "cmdecho" 0)
(setq oldv (getvar "osmode"))
(setvar "LUNITS" 2)
(setvar "LUPREC" 2)
(setq zh (lisped "输入桩号"))
(while (/= zh "-1")
;;; (setq zh (lisped "输入桩号"))
(setq zx_p1 (getpoint"\n 选择轴线点1(按轴线前进方向选择)")
zx_p2 (getpoint"\n 选择轴线点2(按轴线前进方向选择)")
)
(setq zd (getpoint"\n选择中间点"))
(command "circle" zd 1.0)
(setq hdmx (car (entsel"\n选择横断面线")))
(command "layer" "n" "sjd" "")
(setvar "clayer" "sjd")
(setvar "cecolor" "2")
(setq sj_lis ’())
(setq hdmx_ent (entget hdmx))
(setq p1 (cdr (assoc 10 hdmx_ent)))
(if (or (= (cdr (assoc 0 hdmx_ent)) "LINE") (= (cdr (assoc 0 hdmx_ent)) "LWPOLYLINE"))
(progn
(setq out 1)
(while (/= out nil)
(setq sj (getpoint "\n数据定位点"))
(if (= (what_side sj p1 zd) 0)
(progn
(command "circle" sj 1.0)
(if (= (what_side sj zx_p1 zx_p2) 1)
(setq sj_dis (- 0 (distance sj zd)))
(setq sj_dis (distance sj zd))
)
(setq bgd (car (entsel "\n数据点高程")))
(if (and (/= bgd nil) (= (cdr (assoc 0 (entget bgd))) "TEXT"))
(setq bgd (atof (cdr (assoc 1 (entget bgd)))))
(setq bgd (atof (lisped "输入高程")))
)
(command "chprop" "l" "" "c" "3" "")
(setq sj_lis (append sj_lis (list sj_dis bgd)))
)
(setq out nil)
)
)
)
(ai_alert "无法确定横断面数据")
)
(setq dat (mapcar ’rtos sj_lis))
(setq dat (mapcar ’(lambda (x)
(strcat x " ")
)
dat)
)
(setq dat (apply ’strcat dat))
(setq dat (strcat zh " a" " " dat "b "))
(setq ff (open "test.dat" "a"))
(write-line dat ff)
(close ff)
(setq ss (ssget "x" ’((8 . "SJD") (62 . 3))))
(command "erase" "p" "")
(setq zh (lisped "输入桩号"))
)
(setvar "cmdecho" 1)
(setvar "osmode" oldv)
(princ)
)
(defun what_side ( p1 p2 p3 / a dx dx1 dy dy1)
(setq dx (- (car p3) (car p2))
dy (- (cadr p3) (cadr p2))
dx1 (- (car p1) (car p2))
dy1 (- (cadr p1) (cadr p2))
);setq
(setq a (- (* dx dy1) (* dy dx1))
a (rtos a 2 6)
a (atof a)
);setq
(if (not (equal 0.0 a))
(setq a (/ a (abs a)));setq
);if
a
);defun what_side
请各位 大虾解释下 ;;; (setq zh (lisped "输入桩号")) 中;;;是什么意思?
);setq又是什么意思。。。如果行请加我的poPo
谢谢!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
全部回复(3 )
只看楼主 我来说两句我经常用的 航道设计的 做水下工程量计算用的
难道没有哪个高手能说出来吗!!~~~~~
回复 举报
回复 举报