求已知起点终点水平标注标高。求高手出手谢谢
测试文件:
操作:
1---指定起点输入标高
2---指定终点输入标高
3---进行标高标高并生成高度线
麻烦哪位高手出手帮忙谢谢
本帖最后由 夏生生 于 2012-12-21 08:37 编辑
flytoday 发表于 2012-12-21 07:12 http://bbs.mjtd.com/static/image/common/back.gif
沉滴好快顶起哈………
试试 (defun c:test1 ( / oldos pt1 pt2 ptx ang bg1 bg2 bgx dist disx)
(setq oldos (getvar "osmode"))
(setvar "osmode" 513)
(setq pt1(getpoint "\n选择起点:")
bg1(getreal "\n输入起点标高:")
pt2(getpoint "\n选择终点:")
bg2(getreal "\n输入终点标高:")
dist (distance pt1 pt2)
ang(+ (/ pi 2) (angle pt1 pt2))
)
(entmake (list '(0 . "line")
(cons 10 pt1)
(cons 11 (polar pt1 ang (* bg1 1000)))
)
)
(entmake (list '(0 . "text")
'(10 0 0 0)
(cons 11 (polar pt1 ang (* bg1 1000)))
(cons 1 (rtos bg1 2 3))
'(40 . 250)
'(41 . 0.75)
(cons 50 (- ang (/ pi 2)))
'(7 . "standard")
'(72 . 1)
'(73 . 0)
)
)
(entmake (list '(0 . "line")
(cons 10 pt2)
(cons 11 (polar pt2 ang (* bg2 1000)))
)
)
(entmake (list '(0 . "text")
'(10 0 0 0)
(cons 11 (polar pt2 ang (* bg2 1000)))
(cons 1 (rtos bg2 2 3))
'(40 . 250)
'(41 . 0.75)
(cons 50 (- ang (/ pi 2)))
'(7 . "standard")
'(72 . 1)
'(73 . 0)
)
)
(while (setq ptx (getpoint "\n选择插入点:"))
(setq disx (distance pt1 ptx)
bgx(+ bg1 (/ (* disx (- bg2 bg1)) dist))
)
(entmake (list '(0 . "line")
(cons 10 ptx)
(cons 11 (polar ptx ang (* bgx 1000)))
)
)
(entmake (list '(0 . "text")
'(10 0 0 0)
(cons 11 (polar ptx ang (* bgx 1000)))
(cons 1 (rtos bgx 2 3))
'(40 . 250)
'(41 . 0.75)
(cons 50 (- ang (/ pi 2)))
'(7 . "standard")
'(72 . 1)
'(73 . 0)
)
)
)
(setvar "osmode" oldos)
(princ)
) 沉滴好快顶起哈………
麻烦大师改下谢谢~ 来个另类的:两点内插标高
大师麻烦修改下谢谢 flytoday 发表于 2012-12-21 14:27 static/image/common/back.gif
麻烦大师改下谢谢~
(defun c:test1 ( / oldos pt1 pt2 ptx ang bg1 bg2 bgx dist disx)
(setq oldos (getvar "osmode"))
(setvar "osmode" 513)
(setq pt1(getpoint "\n选择起点:")
bg1(getreal "\n输入起点标高:")
pt2(getpoint "\n选择终点:")
bg2(getreal "\n输入终点标高:")
dist (distance pt1 pt2)
ang(+ (/ pi 2) (angle pt1 pt2))
)
(entmake (list '(0 . "text")
'(10 0 0 0)
(cons 11 pt1)
(cons 1 (rtos bg1 2 3))
'(40 . 250)
'(41 . 0.75)
(cons 50 (- ang (/ pi 2)))
'(7 . "standard")
'(72 . 1)
'(73 . 0)
)
)
(entmake (list '(0 . "line")
(cons 10 pt2)
(cons 11 (polar pt2 ang (* (- bg2 bg1) 1000)))
)
)
(entmake (list '(0 . "text")
'(10 0 0 0)
(cons 11 (polar pt2 ang (* (- bg2 bg1) 1000)))
(cons 1 (rtos bg2 2 3))
'(40 . 250)
'(41 . 0.75)
(cons 50 (- ang (/ pi 2)))
'(7 . "standard")
'(72 . 1)
'(73 . 0)
)
)
(while (setq ptx (getpoint "\n选择插入点:"))
(setq disx (distance pt1 ptx)
bgx(+ bg1 (/ (* disx (- bg2 bg1)) dist))
)
(entmake (list '(0 . "line")
(cons 10 ptx)
(cons 11 (polar ptx ang (* (- bgx bg1) 1000)))
)
)
(entmake (list '(0 . "text")
'(10 0 0 0)
(cons 11 (polar ptx ang (* (- bgx bg1) 1000)))
(cons 1 (rtos bgx 2 3))
'(40 . 250)
'(41 . 0.75)
(cons 50 (- ang (/ pi 2)))
'(7 . "standard")
'(72 . 1)
'(73 . 0)
)
)
)
(setvar "osmode" oldos)
(princ)
) xyp1964 发表于 2012-12-21 17:38
来个另类的:两点内插标高
能分享一个吗:lol
页:
[1]