谢谢各位的指教,
又学了一招。
程序写完,共享再指教。
;;;方便简洁的填充程序
- ;;;选择填充[1-填实]/[2-钢筋混凝土]/[3-素混凝土]/[4-砖]/[5-钢材]/[回车进入对话框]
- (defun c:bh ( / ccolor clayer hatch hatchx num)
- (setq CLayer (getvar "clayer")
- CColor (getvar "cecolor")
- )
- (if (= (tblsearch "layer" "Hatch") nil)
- (progn
- (princ "\n Hatch 图层不存在,正在创建...")
- (command "-layer" "n" "Hatch" "c" 252 "Hatch" "")
- )
- )
- (command ".layer" "on" "hatch" "")
- (initget "1 2 3 4 5")
- (if (not (setq num (getkword "\n请选择填充图案:[1-填实]/[2-钢筋混凝土]/[3-素混凝土]/[4-砖]/[5-钢材]/[回车进入对话框]: ")))
- (if (setq p0 (getpoint "\n左键进行填实,右键进入对话框:"))
- (progn
- (princ "\n 请选择内部点: ")
- (setvar "clayer" "Hatch")
- (if (> (atof (getvar "acadver")) 16.0)
- (command "-bhatch" "p" "solid" "dr" "b" pause)
- (command "-bhatch" "p" "solid" pause)
- )
- (while (= (getvar "cmdnames") "-BHATCH")
- (command pause)
- )
- )
- (progn
- (initdia)
- (IF T (command ".bhatch"))
- (while (eq 1 (logand 1 (getvar "CMDACTIVE")))
- (command pause)
- )
- (command "Chprop" (entlast) "" "LA" "hatch" "")
- )
- )
- (progn
- (if (= "1" num)
- (progn
- (princ "\n 请选择内部点: ")
- (setvar "clayer" "Hatch")
- (if (> (atof (getvar "acadver")) 16.0)
- (command "-bhatch" "p" "solid" "dr" "b" pause)
- (command "-bhatch" "p" "solid" pause)
- )
- (while (= (getvar "cmdnames") "-BHATCH")
- (command pause)
- )
- )
- (progn
- (cond
- ((= "2" num)
- (setq hatch "an31c"
- hatchx 1000.
- )
- )
- ((= "3" num)
- (setq hatch "an33c"
- hatchx 1000.
- )
- )
- ((= "4" num)
- (setq hatch "ansi31"
- hatchx 1200.
- )
- )
- ((= "5" num)
- (setq hatch "ansi32"
- hatchx 1000.
- )
- )
- )
- (princ "\n 请选择内部点: ")
- (setvar "clayer" "Hatch")
- (if (> (atof (getvar "acadver")) 16.0)
- (command "-bhatch" "p" hatch hatchx 0. "dr" "b" pause)
- (command "-bhatch" "p" hatch hatchx 0. pause)
- )
- (while (= (getvar "cmdnames") "-BHATCH")
- (command pause)
- )
- )
- )
- (xdrx_draworder->back (entlast))
- ;;; (command ".regen")
- )
- )
- (setvar "clayer" CLayer)
- (setvar "cecolor" CColor)
- (princ)
- )
|