Smirnoff 发表于 2022-7-6 10:28:44

 
谢谢我尽量把事情简单化,就像我的想法一样。很高兴看到你回来-大卫

Lee Mac 发表于 2022-7-6 10:31:30

 
嗨,大卫,这就像一个魔咒,我能为“按层”实体做什么?有没有另一个lisp可以将“按层”与实际颜色交换?。也可以添加线型吗?基于颜色和线型生成图层。层可以命名为“C8隐藏,C8连续,C11虚线,C11隐藏…”
 
谢谢大家

David Bethel 发表于 2022-7-6 10:36:37

对于图层颜色和线型-(这可能会产生一个图层“C256-BYLAYER”)
 
(entmod (subst (cons 8 (strcat "C" (itoa clr)))(assoc 8 ed) ed))
 
对于bylayer值,我将转到图层表,找出当前指定给该图层的颜色和/或线型。
 
默认值为“C7-连续”
 
 
也许还有很多更优雅的方式可以做到这一点,但谁说我很优雅-大卫

arqi 发表于 2022-7-6 10:38:50

具有图层颜色和线型
 

(defun c:encl (/ ss en ed nl)
(and (setq ss (ssget))
      (while (setq en (ssname ss 0))
             (setq ed (entget en))
             (setq nl (if (assoc 62 ed)
                        (strcat "C" (itoa (cdr (assoc 62 ed))))
                        "C256"))
             (setq nl (if (assoc 6 ed)
                        (strcat nl "-" (cdr (assoc 6 ed)))
                        (strcat nl "-BYLAYER")))
             (entmod (subst (cons 8 nl) (assoc 8 ed) ed))
             (ssdel en ss)))
(prin1))

 
 
玩得开心-大卫

David Bethel 发表于 2022-7-6 10:45:36

 
太棒了,大卫,非常感谢!

David Bethel 发表于 2022-7-6 10:46:50

arqi 发表于 2022-7-6 10:51:49

 
awesome david, many thanks!
页: 1 [2]
查看完整版本: 基于颜色生成层