请大佬帮忙修改一下,造福各位设计,取之群,还之群。源码奉上
本帖最后由 yoyrtweq 于 2020-10-10 10:53 编辑我这里有一份快速填充,也是在社区内一个大佬写的代码。用着十分不错,特别拿出来给大家,但有个问题,在2014版中 可以直接点击就能填充进方框内,但是到了2020版以后,直接点击以后, 还会出现两个选择,如何去掉后面这两个选择,跟2014版同样。这样效率就很高了。谢谢大佬修改一些
;;快捷填充
(defun c:se (/ amode)
(initget 128 "q a w s e d r f z x c v qq aa")
(setq amode (getkword
"\n多层Q/木皮A/混凝W/实木S/理石E/玻璃D/布艺R/皮革F/海绵Z/藤编X/密度板C/金属V:")
)
(if (not amode)
(setq amode "q")
)
(setq amode(strcase amode T))
(setq d "T")
(cond ((= amode "q")
(progn
(while (= d "T")
(setq pt (getpoint "请选择填充点:\r"))
(if (= nil pt)
(progn(setq d "F"))
(progn (vl-cmdf ".bhatch" "p" "cork" 40 0 Pt "y" ""))
)
(princ)
)
))
((= amode "a")
(progn
(while (= d "T")
(setq pt (getpoint "请选择填充点:\r"))
(if (= nil pt)
(progn(setq d "F"))
(progn (vl-cmdf ".bhatch" "p" "Mupi" 350 0 Pt "y" ""))
)
(princ)
)
))
((= amode "w")
(progn
(while (= d "T")
(setq pt (getpoint "请选择填充点:\r"))
(if (= nil pt)
(progn(setq d "F"))
(progn (vl-cmdf ".bhatch" "p" "Hunlingtu" 10 0 Pt "y" ""))
)
(princ)
)
))
((= amode "s")
(progn
(while (= d "T")
(setq pt (getpoint "请选择填充点:\r"))
(if (= nil pt)
(progn(setq d "F"))
(progn (vl-cmdf ".bhatch" "p" "Shimu" 50 0 Pt "y" ""))
)
(princ)
)
))
((= amode "e")
(progn
(while (= d "T")
(setq pt (getpoint "请选择填充点:\r"))
(if (= nil pt)
(progn(setq d "F"))
(progn (vl-cmdf ".bhatch" "p" "Dalishi" 1 0 Pt "y" ""))
)
(princ)
)
))
((= amode "d")
(progn
(while (= d "T")
(setq pt (getpoint "请选择填充点:\r"))
(if (= nil pt)
(progn(setq d "F"))
(progn (vl-cmdf ".bhatch" "p" "ar-rroof" 50 45 Pt "y" ""))
)
(princ)
)
))
((= amode "r")
(progn
(while (= d "T")
(setq pt (getpoint "请选择填充点:\r"))
(if (= nil pt)
(progn(setq d "F"))
(progn (vl-cmdf ".bhatch" "p" "cross" 200 0 Pt "y" ""))
)
(princ)
)
))
((= amode "f")
(progn
(while (= d "T")
(setq pt (getpoint "请选择填充点:\r"))
(if (= nil pt)
(progn(setq d "F"))
(progn (vl-cmdf ".bhatch" "p" "hound" 300 0 Pt "y" ""))
)
(princ)
)
))
((= amode "z")
(progn
(while (= d "T")
(setq pt (getpoint "请选择填充点:\r"))
(if (= nil pt)
(progn(setq d "F"))
(progn (vl-cmdf ".bhatch" "p" "honey" 40 0 Pt "y" ""))
)
(princ)
)
))
((= amode "x")
(progn
(while (= d "T")
(setq pt (getpoint "请选择填充点:\r"))
(if (= nil pt)
(progn(setq d "F"))
(progn (vl-cmdf ".bhatch" "p" "earth" 200 0 Pt "y" ""))
)
(princ)
)
))
((= amode "c")
(progn
(while (= d "T")
(setq pt (getpoint "请选择填充点:\r"))
(if (= nil pt)
(progn (setq d "F"))
(progn(vl-cmdf ".bhatch" "p" "ar-sand" 5 0 Pt "y" ""))
)
(princ)
)
))
((= amode "v")
(progn
(while (= d "T")
(setq pt (getpoint "请选择填充点:\r"))
(if (= nil pt)
(progn(setq d "F"))
(progn(vl-cmdf ".bhatch" "p" "ANSI36" 30 0 Pt "y" ""))
)
(princ)
)
))
((= amode "qq")
(progn
(while (= d "T")
(setq pt (getpoint "请选择填充点:\r"))
(if (= nil pt)
(progn(setq d "F"))
(progn(vl-cmdf ".bhatch" "p" "cork" 40 90 Pt "y" ""))
)
(princ)
)
))
((= amode "aa")
(progn
(while (= d "T")
(setq pt (getpoint "请选择填充点:\r"))
(if (= nil pt)
(progn(setq d "F"))
(progn(vl-cmdf ".bhatch" "p" "Mupi" 350 90 Pt "y" ""))
)
(princ)
)
))
)
(princ)
)
烟盒迷唇 发表于 2020-10-11 08:55
图片看不到,不知道有什么区别。
有区别,2014中直接填充,2020中填充后需要再点2次空格 烟盒迷唇 发表于 2020-10-11 19:33
那就版本判断,高版本的添加2个空格进去啊。
就是不知道怎么添加, 烟盒迷唇 发表于 2020-10-12 09:20
把每个里面的“Y”去掉就可以了。
解决了3Q 支持一个!!!!!顶上去 图片看不到,不知道有什么区别。 那就版本判断,高版本的添加2个空格进去啊。 yoyrtweq 发表于 2020-10-11 20:23
就是不知道怎么添加,
把每个里面的“Y”去掉就可以了。
支持一个!! 实用的功能,谢谢分享
页:
[1]
2