iCAx开思网
标题:
autovad中快速画球标
[打印本页]
作者:
tgliu
时间:
2008-1-27 14:06
标题:
autovad中快速画球标
各位,
我们通常要画装配图时要画球标,但是和autocad来画太麻烦,
与用其他外挂又要诸多条件,
本人写了一个程式,很实用,
把下面代码粘贴到记事本,然后另存为qb.lsp文年,然后再在autocad中加载,
然后在autocad命令行中键入QB即可
此引线箭头样式可在标注样式中修改。
下面是原代码:
(defun c:qb()
(prompt "\n******画球标<C
B>******")
(setq n 1)
(setvar "cmdecho" 0)
(setq os (getvar "osmode"))
(setq la (getvar "clayer"))
(setq lay (tblsearch "layer" "DIM"))
(if (null lay)
(command "layer" "N" "DIM" "c" "GREEN" "DIM" "l" "CONTINUOUS" "DIM" "lw" "0.13" "DIM" "")
)
(setq pt (getpoint "\n起点:"))
(while pt
(setq pt1 (getpoint pt "\n下一点:"))
(setq str (strcat "\n请输入编号<" (rtos n) ">:" ))
(setq st (getint str))
(if (null st)
(setq st n)
(setq n st)
)
(setq h1 (getvar "dimtxt"))
(setq ss (getvar "dimscale"))
(setq hh (* h1 ss))
(setq ang (angle pt pt1))
(if (< ang (/ pi 2)) (setq a 0))
(if (> ang (/ pi 2)) (setq a pi))
(if (> ang (* pi 1.5)) (setq a 0))
(setq pt2 (polar pt1 a (* 2 hh)))
(setq la (getvar "clayer"))
(setvar "clayer" "DIM")
(setvar "osmode" 0)
(command "leader" pt pt1 pt2 "" "" "n")
(setq pt3 (polar pt1 a hh))
(setq pts (polar pt3 (/ pi 2) (+ 0.5 hh)))
(command "circle" pts hh)
(command "text" "j" "mc" pts hh "" st )
(setq n (+ n 1))
(setvar "osmode" 39)
(setq pt (getpoint "\n起点:"))
)
(setvar "clayer" la)
(setvar "osmode" os)
(prompt "\n******画球标******")
(prin1)
)
请各位试用
f:\qb.jpg
作者:
801215
时间:
2008-1-27 16:06
其實塊也很快的.....
欢迎光临 iCAx开思网 (https://www.icax.org/)
Powered by Discuz! X3.3