发布于:2016-07-29 10:46:29
来自:建筑设计/CAD下载及教程
[复制转发]
;标注标高:
(defun c:bg(/ xs_d os dim jd i_sc i_bg i_uni bg_jz pt_jz zb_jz pt_nt zb_nt bg_nt)
(setvar "cmdecho" 0)
(setvar "dimzin" 0)
(setvar "blipmode" 0)
(setq xs_d (getvar "dimzin"))
(setq os (getvar "osmode"))
(setq dim (getvar "dimzin"))
(chk_style)
(princ "\n适用于真实尺寸作图")
(setq i_uni (getstring "\n图纸单位是mm/cm/m
:")) (if (= "m" i_uni) (setq i_uni "m"))
(cond ((= i_uni "mm") (setq i_bg 1000.0))
((= i_uni "cm") (setq i_bg 100.0))
((= i_uni "m") (setq i_bg 1.0))
(t (setq i_bg 1.0))
)
(if (setq jd (getint "\n标高有效位数<3>:")) () (setq jd 3))
(if (setq i_sc (getreal "\n比例系数<1>:")) () (setq i_sc 1))
(if (setq bg_jz (getreal "\n输入基准点标高<100.0>:")) () (setq bg_jz 100.0))
(setq pt_jz (getpoint "\n指定基准点:"))
(setq zb_jz (cadr pt_jz))
(d_fh pt_jz bg_jz) ;绘制基准点
(while (setq pt_nt (getpoint "\n指定下一点:"))
(progn
(setq zb_nt (cadr pt_nt))
(setq bg_nt (+ bg_jz (/ (- zb_nt zb_jz) i_bg)))
(d_fh pt_nt bg_nt);绘制标准点
)
)
(setvar "dimzin" xs_d)
(setvar "dimzin" dim)
)
;;测试子程序
(defun bg:css(/ pt bg)
(setq pt (getpoint "\n````"))
(setq bg 100.0)
(setq jd 2)
(setq i_sc 1)
(d_fh)
)
;;标注标高
(defun d_fh(pt bg / pt1)
(setvar "osmode" 0)
(command "pline" (polar (polar pt 0 (* 0.0 i_sc)) (/ pi -1.5) (* -1.5 i_sc))
(polar pt 0 (* 0.0 i_sc)) (polar (polar pt 0 (* 0.0 i_sc)) (* 1 (/ pi 1.5)) (* 1.5 i_sc))
(polar (polar pt 0 (* 0.0 i_sc)) (* 1 (/ pi 1.5)) (* 1.5 i_sc)) (polar (polar (polar pt 0 (* 0.0 i_sc)) (* 1 (/ pi 1.5)) (* 1.5 i_sc)) 0 (* 5 i_sc)) "")
(setq pt1 (polar (polar (polar pt 0 (* 0.0 i_sc)) (* 2 (/ pi 2.3)) (* 3.0 i_sc)) 0 (* 5.0 i_sc)))
(command "_.text" "j" "m" (polar pt1 (/ pi 2) (* 1.8 i_sc)) (* 2.5 i_sc) "0" (rtos bg 2 jd))
(setvar "osmode" os)
)
(defun chk_style();检查字型
(setq chksty(tblsearch "style" "standard"))
(if (null chksty)
(progn
(command "TEXTSTYLE" "standard" )
))
(setq chklay(tblsearch "layer" "清淤前"))
(if (null chklay)
(command "_layer" "m" "清淤前" "c" "3" "清淤前" "")
)
(setvar "clayer" "清淤前")
(setvar "textstyle" "KS")
)
(princ "\n--自动标注标高程序 ")
(prin1)
全部回复(5 )
只看楼主 我来说两句回复 举报
回复 举报