又是我-遍历SS
再一次嗨!我还有一个问题。如果我想使用(ssget)更改多个对象的DXF值,该怎么办。我在寻找答案。我不知道怎么做。提前感谢! 您需要遍历集合,然后依次更改每个实体的DXF。
看看我的许多例子,我经常这样做。
我相信我甚至把你和这样一个例子联系在一起(把所有的实体都变成绿色)眨眼:
李 嗯,我得看看。 我看了你的一篇帖子,它正是我想要的。我只是改变了一些颜色,而不是图层,我改变了线型。但我只是想确保我理解这个代码
(defun c:doit (/ i ss ent eLst)
(if (setq i -1 ;i'm guessing this is for the "while" counter
ss (ssget "_:L"));this is the selection set.not sure what kind if selec :L is
(while
(setq ent ;variable for the entity name
(ssname ss
(setq i (1+ i)))) ;this will continue to +1 untill it runs out of object entities
;when it runs out it returns nil and stops the loop.
;(1+ i) = 0 which is first entity in selection set
(setq eLst (entget ent)) ;retrieve DXF codes
(setq eLst (subst '(8 . "0") (assoc 8 eLst) eLst)) ;modify DXF
(entmod ;all of this is incase a DXF code does not exist.
(if (assoc 62 eLst)
(subst '(62 . 3) (assoc 62 eLst) eLst)
(append eLst '((62 . 3)))))))
(princ)) 据我所知,需要(append)调用的组包括:
[列表]
[*]-3-扩展数据
[*]6-线型
[*]39-厚度
[*]48-LTYPEScale
[*]62-颜色
[/列表]
67在R12中需要它,但从那以后就不再需要了。
他们可能会在更新的东西更多-大卫 (ssget "_:L")
过滤掉锁定层上的实体。
页:
[1]