本帖最后由 飞雪神光 于 2023-6-26 17:07 编辑
- (defun c:AQ(/ ang p0 p1 p2 p3 pc pd tt xz1)
- (vl-load-com)
- (setvar "cmdecho" 0)
- (setq TCBF (getvar "clayer"))
- (setvar "osmode" 16383)
- (setq dimzin (getvar "dimzin"))
- (setvar "dimzin" 0)
- (or t3 (setq t3 '(0.950)))
- (mapcar 'set '( t2 ) t3)
- (if (setq t1 (getreal (strcat "\n默认高度<" (rtos T2 2 3) ">: ")))
- (setq t2 t1)
- )
- (setq t3 (list t2 ))
- (setq p0 (getpoint "\n指定第一点:"))
- (setq p1 (getpoint p0 "\n指定第二点:"))
- (setq P2 (polar P1 (- (angle P0 P1) (/ PI 2)) 200))
- (setq P3 (polar P0 (- (angle P0 P1) (/ PI 2)) 200))
- (setq ang (angle p0 p1))
- (setq ang (atoi (angtos ang 0 0)))
- (while (> ang 90) (setq ang (- ang 180)))
- (setq ang (/ (* ang pi) 180))
- (setq pc (polar p0 (angle p0 p2) (/ (distance p0 p2) 2)))
- (setq PD (polar PC (- (angle P0 P1) (/ Pi 2)) 200))
- (setq tt (strcat "CT:Hs+" (rtos (abs T2) 2 3)))
- (setvar "dimzin" dimzin)
- (setvar "OSMODE" 0)
- (command "layer" "m" "T-窗台" "c" "120" "T-窗台" "")
- (command "PLINE" P0 P1 P2 P3 "C")
- (setq xz1 (entlast))
- (command "-HATCH" "P" "AR-HBONE" "" ang "S" XZ1 "" "")
- (entmake
- (list
- '(0 . "text")
- (cons 8 "T-窗台")
- (cons 72 4)
- (cons 1 TT)
- (cons 41 0.6)
- (cons 10 pD)
- (cons 11 pD)
- (cons 40 120)
- (cons 50 ang)
- (cons 7 "Standard")
- )
- )
- (setvar "clayer" TCBF)
- (setvar "cmdecho" 1)
- (prin1)
- )
|