- UID
- 490679
- 积分
- 286
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2006-9-15
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
本帖最后由 qqp741005 于 2019-10-16 10:35 编辑
用各种CAD成图软件生成的纵横断面图,大部分都
需要修改才能使用,修改之后的高程标注免不了,
如果修改量特别多特别大的话,是需要花很多时间
才能完成的,有了该插件能事半功倍的效果,按命
令行提示输入字高 在图中指定任意点(不需要带
属性都可以)输入给定改点的高程数值,就可以在
断面内的任意需要高程标注的位置标注高程数值(
带▽的高程数值)插件命令:bzgc
插件源码:
; 标注高程
(defun c:bzgc()
(command "style" "高程标注黑体" "黑体" "" 0.85 "" "" "")
(if (= hzt nil) (setq hzt 1))
(setq thzt hzt)
(setq thzt (getdist (strcat "\n 文字高度<" (rtos thzt) ">:")))
(if thzt (setq hzt thzt))
(initget 1 "A B ")
(setq gclx (getkword "\n 绝对高程(A) / 相对于某点的高程(B) <A>:"))
(cond
((= gclx "A")
(progn (setq ypt0 0)
(setq Hpt0 0)
(setq hbl 1)
)
)
((= gclx "B")
(progn (setq ypt0 (nth 1 (getpoint "\n 点取基准点位置:")))
(setq Hpt0 (getreal "\n 该基准点高程:"))
(if (= hbl nil) (setq hbl 1))
(setq thbl hbl)
(setq thbl (getreal (strcat "\n 高度放大比例<" (rtos thbl) ">:")))
(if thbl (setq hbl thbl))
)
)
((= gclx "")
(progn (setq ypt0 0)
(setq Hpt0 0)
(setq hbl 1)
)
)
((= gclx nil)
(progn (setq ypt0 0)
(setq Hpt0 0)
(setq hbl 1)
)
)
(t nil)
)
(if (= wz nil)(setq wz "TC"))
(initget 1 "TL TC TR BL BC BR ")
(setq tWZ (getkword (strcat "\n文字位于标注点的方位: 左上(TL) /中上(TC)/右上
(TR)/ 左下(BL) /中下(BC)/右下(BR) <" wz ">:")))
(if (/= twz "") (setq wz twz))
(while (setq pt (getpoint "\n 点取标注点位置:"))
(setq p1 pt)
(if (= (substr wz 1 1) "T")
(progn(setq p2 (polar pt (- (* pi 0.5) (/ pi 6)) hzt))
(setq p3 (polar pt (+ (* pi 0.5) (/ pi 6)) hzt))
(setq p2p (polar pt (- (* pi 0.5) (/ pi 6)) (* hzt 1.1)))
(setq p3p (polar pt (+ (* pi 0.5) (/ pi 6)) (* hzt 1.1)))
)
)
(if (= (substr wz 1 1) "B")
(progn (setq p2 (polar pt (+ (* pi 1.5) (/ pi 6)) hzt))
(setq p3 (polar pt (- (* pi 1.5) (/ pi 6)) hzt))
(setq p2p (polar pt (+ (* pi 1.5) (/ pi 6)) (* hzt 1.1)))
(setq p3p (polar pt (- (* pi 1.5) (/ pi 6)) (* hzt 1.1)))
)
)
(if (or (= wz "TL") (= wz "BL") ) (progn (setq p4p p3p) (setq p4 p3) (setq p5 (polar p4 pi (* hzt 2)))))
(if (or (= wz "TC") (= wz "BC") ) (setq p4p (list (/(+ (nth 0 p2p)(nth 0 p3p))2) (/(+ (nth 1 p2p)(nth 1 p3p))2) )) )
(if (or (= wz "TR") (= wz "BR") ) (progn (setq p4p p2p)(setq p4 p2) (setq p5 (polar p4 0 (* hzt 2)))))
(if (= (substr wz 1 1) "T")
(setq pwz (strcat "B" (substr wz 2 1)))
(setq pwz (strcat "T" (substr wz 2 1)))
)
(if (= (substr wz 2 1) "L")
(setq pwz (strcat(substr pwz 1 1) "R" ))
(if (/= (substr wz 2 1) "C") (setq pwz (strcat (substr pwz 1 1) "L")))
)
(setq os (getvar "osmode"))
(setvar "osmode" 0)
(command "text" "s" "高程标注黑体" "j" pwz p4p (/ hzt 1.5) 0 (rtos (+ hpt0
(/ (- (nth 1 pt) ypt0 ) hbl)) 2 3) "")
(command "pline" p1 p2 p3 "c")
(if (/= (substr wz 2 1) "C") (command "line" p4 p5 ""))
(setvar "osmode" os)
)
);defun
; 显示高程
(defun c:xsgc()
(initget 1 "A B ")
(setq gclx (getkword "\n 绝对高程(A) / 相对于某点的高程(B) <A>:"))
(cond
((= gclx "A")
(progn (setq ypt0 0)
(setq Hpt0 0)
(setq hbl 1)
)
)
((= gclx "B")
(progn (setq ypt0 (nth 1 (getpoint "\n 点取基准点位置:")))
(setq Hpt0 (getreal "\n 该基准点高程:"))
(if (= hbl nil) (setq hbl 1))
(setq thbl hbl)
(setq thbl (getreal (strcat "\n 高度放大比例<" (rtos thbl) ">:")))
(if thbl (setq hbl thbl))
)
)
((= gclx "")
(progn (setq ypt0 0)
(setq Hpt0 0)
(setq hbl 1)
)
)
((= gclx nil)
(progn (setq ypt0 0)
(setq Hpt0 0)
(setq hbl 1)
)
)
(t nil)
)
(while (setq pt (getpoint "\n 点取标注点位置:"))
(princ (rtos (+ hpt0 (/ (- (nth 1 pt) ypt0 ) hbl)) 2 3) )
)
);defun
|
|