GL6过梁自动绘标6左下.LSP
资源名称:cadlisp1.rar [点击查看]
上传用户:sd555111
上传日期:2014-05-17
资源大小:31k
文件大小:3k
源码类别:
CAD
开发平台:
MathCAD
- ; =============================================
- ; | 过梁自动标注软件 |
- ; | 版本: V1.1 作者: 尉迟俊岭 |
- ; =============================================
- (defun C:gl6(/ dx dy dx1 dx2 dx3 dx4 dx5 dx6 dx7 dx8 dy1 dy2 pt dxt dyt qt dyz
- scale txt high lay pt1 pt2 pt3 pt4 pt5 pt6 pt7 pt8 pt8 pt10 ptt dis with tt c)
- (setvar "CMDECHO" 0)
- (setq lay (getvar "clayer"))
- (command "color" "bylayer")
- (command "layer" "m" "gl" "c" "m" "gl" "")
- (if (or (= nil (tblsearch "style" "xw"))
- (/= (cdr (assoc 40 (tblsearch "style" "xw"))) 0)
- )
- (command "STYLE" "xw" "txt" "0" ".8" "0" "n" "n" "n")
- )
- (command "osnap" "int")
- (setq pt (getpoint "n指定插入点(标注在插入点的左下方) <int mode>: "))
- (command "osnap" "non")
- (if (= scab nil) (setq scab 1.0))
- (princ "n比例值取1到100之间任意数!")
- (setq scale (getreal (strcat "n输入比例数值 <" (rtos scab 2 0) ">:")))
- (if (= scale nil) (setq scale scab))
- (setq scab scale)
- (if (= nil d) (setq d 240.0))
- (setq dis (getreal (strcat "n输入到插入点的距离 <" (rtos d 2 0) ">:")))
- (if (= nil dis) (setq dis d))
- (setq d dis dis (* (/ dis 100.0) scale))
- (if (= nil w) (setq w 900.0))
- (setq with (getreal (strcat "n输入门或窗的宽度 <" (rtos w 2 0) ">:")))
- (if (= nil with) (setq with w))
- (setq w with with (* (/ with 100.0) scale))
- (if (= nil q) (setq q 240.0))
- (setq qt (getreal (strcat "n输入墙壁的厚度 <" (rtos q 2 0) ">:")))
- (if (= nil qt) (setq qt q))
- (setq q qt qt (* (/ qt 100.0) scale))
- (setq dy (cadr pt))
- (setq dx (car pt))
- (setq dx2 (- dx dis))
- (setq dx1 (- dx2 with))
- (setq dy2 (+ dy (* 0.6 scale)))
- (setq dy1 (- (- dy2 qt) (* 1.2 scale)))
- (setq pt1 (list dx1 dy1))
- (setq pt2 (list dx1 dy2))
- (command "line" pt1 pt2 "")
- (setq pt3 (list dx2 dy1))
- (setq pt4 (list dx2 dy2))
- (command "line" pt3 pt4 "")
- (setq dx3 (- dx1 (* 2.4 scale)))
- (setq dyz (- dy (/ qt 2.0)))
- (setq pt5 (list dx3 dyz))
- (setq tmp (/ (- with (* 3 scale)) 2.0))
- (setq dx4 (+ dx1 tmp))
- (setq pt6 (list dx4 dyz))
- (command "pline" pt5 "w" (* 0.6 scale) (* 0.6 scale) pt6 "")
- (setq dx5 (+ dx4 (* 1 scale)))
- (setq dx6 (+ dx5 (* 1 scale)))
- (setq pt7 (list dx5 dyz))
- (setq pt8 (list dx6 dyz))
- (command "pline" pt7 "w" (* 0.6 scale) (* 0.6 scale) pt8 "")
- (setq dx7 (+ dx6 (* 1 scale)))
- (setq dx8 (+ dx2 (* 2.4 scale)))
- (setq pt9 (list dx7 dyz))
- (setq pt10 (list dx8 dyz))
- (command "pline" pt9 "w" (* 0.6 scale) (* 0.6 scale) pt10 "")
- (setq dyt (- dy1 (* 4.9 scale)))
- (setq dxt (+ dx5 (* 0.5 scale)))
- (setq txt "0")
- (setq high (* 4 scale))
- (setq tt (strcat (rtos (/ qt (* 1.2 scale)) 2 0) "GL" (rtos (/ with scale) 2 0) ".4"))
- (setq c 1)
- (while (/= txt "")
- (setq txt (getstring (strcat "n输入标注文字 <" tt ">:")))
- (if (and (= txt "") (= c 1)) (setq txt tt))
- (setq c nil tt "None")
- (if (/= txt "")
- (progn
- (setq ptt (list dxt dyt))
- (command "text" "s" "xw" "c" ptt high "0" txt)
- (setq dyt (- dyt (* 5.15 scale)))
- )
- )
- )
- (command "layer" "s" lay "")
- (princ)(princ)
- )