土木在线论坛 \ 建筑设计 \ CAD下载及教程 \ 标高标注LISP程序;

标高标注LISP程序;

发布于: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 )

只看楼主 我来说两句
  • sswylj
    sswylj 沙发
    怎么用?求指导求说明
    2016-09-19 16:54:19

    回复 举报
    赞同0
  • pengshunhui
    pengshunhui 板凳
    能行吗?试一试才知道。
    2016-09-08 23:41:08

    回复 举报
    赞同0
加载更多
这个家伙什么也没有留下。。。

CAD下载及教程

返回版块

52.09 万条内容 · 667 人订阅

猜你喜欢

阅读下一篇

CAD2012版本出现"type Y to reset "怎么处理

大家好,有时候打开CAD2012版本是老是出现"type Y to reset ",然后输入“Y”后,CAD报错然后关闭,一天出现好多次,有高手能给解决吗,谢谢网上也查了,但是没有找到彻底解决的办法

回帖成功

经验值 +10