📄 zbbz.lsp.lsp
字号:
(defun c:bzzb()
(if (= hzt nil) (setq hzt 1))
(setq thzt hzt)
(setq thzt (getdist (strcat "\n 文字高度<" (rtos thzt) ">:")))
(if thzt (setq hzt thzt))
(command "style" "standard" "黑体" hzt 1 "" "" "")
(initget 1 "A B ")
(setq gclx (getkword "\n 绝对坐标(A) / 相对于某点的坐标(B) <A>:"))
(setq pt0 (list 0 0))
(cond
((= gclx "A")
(progn (setq xpt0 0)
(setq ypt0 0)
)
)
((= gclx "B")
(progn (setq pt0 (getpoint "\n 点取基准坐标点位置:"))
(setq xpt0 (getreal "\n 该基准点X=:"))
(setq ypt0 (getreal "\n 该基准点y=:"))
)
)
((= gclx "")
(progn (setq xpt0 0)
(setq ypt0 0)
)
)
((= gclx nil)
(progn (setq xpt0 0)
(setq ypt0 0)
)
)
(t nil)
)
(if (= wz nil)(setq wz "TR"))
(initget 1 "TL TR BL BR ")
(setq tWZ (getkword (strcat "\n文字位于标注点的方位: 左上(TL) /右上(TR)/ 左下(BL) /右下(BR) <" wz ">:")))
(if (/= twz "") (setq wz twz))
(setq os (getvar "osmode"))
(while (setq pt (getpoint "\n 点取标注点位置:"))
(if (= wz "TR")(setq p1 (list (+ (nth 0 pt) (* hzt 5)) (+ (nth 1 pt) (* hzt 5)))))
(if (= wz "TL")(setq p1 (list (- (nth 0 pt) (* hzt 5)) (+ (nth 1 pt) (* hzt 5)))))
(if (= wz "BL")(setq p1 (list (- (nth 0 pt) (* hzt 5)) (- (nth 1 pt) (* hzt 5)))))
(if (= wz "BR")(setq p1 (list (+ (nth 0 pt) (* hzt 5)) (- (nth 1 pt) (* hzt 5)))))
(command "point" pt)
(setvar "osmode" 0)
(setq xpt (+ (- (nth 1 pt) (nth 1 pt0)) xpt0) ypt (+ (- (nth 0 pt) (nth 0 pt0)) ypt0))
(command "leader" pt p1 "" (strcat "x=" (bl3 xpt)) (strcat "y=" (bl3 ypt)) "")
(setvar "osmode" os)
)
);defun
(defun bl3(x)
(setq sintx (rtos x 2 3))
(setq abx (abs x))
(setq sxsd (rtos (- abx (fix abx )) 2 3))
(setq lx (strlen sxsd))
(if (= lx 1) (setq s (strcat sintx ".000")))
(if (= lx 3) (setq s (strcat sintx "00")))
(if (= lx 4) (setq s (strcat sintx "0")))
(if (= lx 5) (setq s (strcat sintx "")))
(princ s)
)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -