各位大哥帮忙看下,拉进CAD界面加载就正常,设置启动组,自动加载就没了边框线
各位大哥帮忙看下,这个拉进CAD界面加载就正常,可是设置启动组,自动加载就没了边框线 ,我看了函数都没哪里有问题啊,请各位大佬指点下;;快速填充command版本
;;code by edata@mjtd
;;2014-6-16
;;变函数参数
;;(sk_hatch_cmd sk_ha_name sk_ha_scale sk_ha_ang)
;;sk_ha_name 填充名字符串
;;sk_ha_scale 填充比例 数字或数字字符串
;;sk_ha_ang 填充角度 0-360度数字或数字字符串
;;例子(sk_hatch_cmd "earth" 100 0.0)
(defun sk_hatch_cmd( sk_ha_name sk_ha_scale sk_ha_ang / bak_clay bak_col bak_cmd en0 en1 en2 p1 p3)
(or sk_ha_name (setq sk_ha_name "earth"))
(or sk_ha_scale (setq sk_ha_scale 100))
(or sk_ha_ang (setq sk_ha_ang 0.0))
(setq bak_clay(getvar 'clayer)
bak_col(getvar 'cecolor)
bak_cmd(getvar 'cmdecho)
)
(if(not(tblobjname "layer" "00-填充"))
(entmake (list '(0 . "LAYER")
'(100 . "AcDbSymbolTableRecord")
'(100 . "AcDbLayerTableRecord")
'(70 . 0)
'(6 . "Continuous")
(cons 2 "00-填充")
(cons 62 251)
)
)
)
(setvar 'cmdecho 0)
(while (and(setq p1(getpoint "\n指定第一点:"))
(setq p3(getcorner p1 "\n指定对角点:"))
)
(progn
(if(> (getvar 'cmdactive) 0)(command))
(setq en0(entlast))
(command "_.RECTANG" "_non" p1 "_non" p3)
(command "change" (entlast) "" "P" "C" 8 "")
(setq en1(entlast))
(command "-bhatch" "p" sk_ha_name sk_ha_scale sk_ha_ang "s" en1 "" "")
(if(> (getvar 'cmdactive) 0)(command))
(command "change" (entlast) "" "P" "la" "00-填充" "")
(setq en2(entlast))
(if(sk_h5_eq en1 en2)
(progn
(alert "创建填充失败.")
(if (not(sk_h5_eq en1 en0)) (entdel en1))
)
)
)
)
(and bak_clay(setvar 'clayer bak_clay))
(and bak_col(setvar 'cecolor bak_col))
(and bak_cmd(setvar 'cmdecho bak_cmd))
(princ)
)
(defun sk_dxf(ent code)(cdr(assoc code (entget ent))))
(defun sk_h5_eq(ent1 ent2)
(= (sk_dxf ent1 5)(sk_dxf ent2 5))
)
(defun c:RF()
(sk_hatch_cmd "CORK" 25 0.0)
(princ)
)
(defun c:RFF()
(sk_hatch_cmd "ANSI38" 30 0.0)
(princ)
)
本帖最后由 gaics 于 2023-8-19 14:07 编辑
没啥问题。但是也不用这么繁琐的代码吧?
我自己是这样用的:
(defun c:hh (/ en ly *error* err myerr)
(defun myerr (msg)
(setvar 'CLAYER ly)
(setq *error* err)
)
(setq err *error* *error* myerr)
(setvar 'CMDECHO 0)
(setq ly (getvar 'CLAYER))
(if (= (tblsearch "layer" "HAT") nil)
(command "layer" "N" "HAT" "l" "Continuous" "HAT" "c" 8 "HAT" "")
)
(setvar 'CLAYER "HAT")
(command "_.rectang" pause pause)
(command "_.hatch" "ansi37" "1" "0" "L" "")
(setvar 'CLAYER ly)
(princ)
)
gaics 发表于 2023-8-19 13:47
没啥问题。但是也不用这么繁琐的代码吧?
我自己是这样用的:
谢谢大佬,可能是我这边插件冲突了
页:
[1]