GL8过梁自动绘标8下右.LSP
资源名称:cadlisp1.rar [点击查看]
上传用户:sd555111
上传日期:2014-05-17
资源大小:31k
文件大小:3k
源码类别:
CAD
开发平台:
MathCAD
- ; =============================================
- ; | 过梁自动标注软件 |
- ; | 版本: V1.1 作者: 尉迟俊岭 |
- ; =============================================
- (defun C:gl8(/ dx dy dy1 dy2 dy3 dy4 dy5 dy6 dy7 dy8 dx1 dx2 pt dxt dyt qt dxz
- 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 "nThickness of wall <" (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 dy2 (- dy dis))
- (setq dy1 (- dy2 with))
- (setq dx2 (- dx (* 0.6 scale)))
- (setq dx1 (+ (+ dx2 qt) (* 1.2 scale)))
- (setq pt1 (list dx1 dy1))
- (setq pt2 (list dx2 dy1))
- (command "line" pt1 pt2 "")
- (setq pt3 (list dx1 dy2))
- (setq pt4 (list dx2 dy2))
- (command "line" pt3 pt4 "")
- (setq dy3 (- dy1 (* 2.4 scale)))
- (setq dxz (+ dx (/ qt 2.0)))
- (setq pt5 (list dxz dy3))
- (setq tmp (/ (- with (* 3 scale)) 2.0))
- (setq dy4 (+ dy1 tmp))
- (setq pt6 (list dxz dy4))
- (command "pline" pt5 "w" (* 0.6 scale) (* 0.6 scale) pt6 "")
- (setq dy5 (+ dy4 (* 1 scale)))
- (setq dy6 (+ dy5 (* 1 scale)))
- (setq pt7 (list dxz dy5))
- (setq pt8 (list dxz dy6))
- (command "pline" pt7 "w" (* 0.6 scale) (* 0.6 scale) pt8 "")
- (setq dy7 (+ dy6 (* 1 scale)))
- (setq dy8 (+ dy2 (* 2.4 scale)))
- (setq pt9 (list dxz dy7))
- (setq pt10 (list dxz dy8))
- (command "pline" pt9 "w" (* 0.6 scale) (* 0.6 scale) pt10 "")
- (setq dxt (+ dx1 (* 4.9 scale)))
- (setq dyt (+ dy5 (* 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 "90" txt)
- (setq dxt (+ dxt (* 5.15 scale)))
- )
- )
- )
- (command "layer" "s" lay "")
- (princ)(princ)
- )