Bill Tillman 发表于 2022-7-5 17:27:36

Entmake Layers有效,但I

我正在使用这个小例程向图形中添加一些新图层:
如果我为颜色发送的值是3、2或1之类的数字,效果会很好。但如果我发送“白色”或“绿色”之类的文本,它将无法工作。我尝试使用DXF代码420代替62,但仍然得到相同的结果。

Bill Tillman 发表于 2022-7-5 17:45:56

好的,我发现解决方案是使用另一个例程,430作为DXF代码,而不是62。希望只使用一个例程。
 
哎呀,事实上这并没有解决问题。使用430,所有颜色都默认为“白色”,并发送类似“洋红”或“青色”的内容。

iconeo 发表于 2022-7-5 18:08:45

你可以把白色转换成7,等等。
 
使用Tapatalk从我的SM-G920T发送

Tharwat 发表于 2022-7-5 18:18:42


(defun _pick:colour(clr / clrs pos)
;; Tharwat - 22.Jul.2016        ;;
(setq clrs '("red" "yellow" "green" "cyan" "blue" "magenta" "white"))
(if (and (= (type clr) 'STR) (setq pos (member (strcase clr t) clrs)))
   (1+ (vl-position (car pos) clrs))
   (if (and (numberp clr) (< 0 clr 257))
   clr
   )
   )
)

BIGAL 发表于 2022-7-5 18:28:37

或者在entmake之前使用cond
 
2
页: [1]
查看完整版本: Entmake Layers有效,但I