- 积分
- 632
- 明经币
- 个
- 注册时间
- 2011-11-11
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
# 枫叶版pycad 感谢飞狐,山人,枫叶,闻人南的示例
#让pycad不放弃每一个打螺丝人
@Command()
def changeColor22(doc): #group组改色:根据组名改色
groupName = 'GR1'
db = doc.Database
with dbtrans(doc) as tr:
dict_ids = db.GroupDictionaryId
group_dicts = list(tr.getobject(dict_ids, acdb.OpenMode.ForWrite))
for group_dict in group_dicts:
if (group_dict.Key == groupName ):
group = group_dict.Value.GetObject(acdb.OpenMode.ForWrite)
ids3 = group.GetAllEntityIds()
for objid in ids3:
obj = tr.getobject(objid, acdb.OpenMode.ForWrite)
obj.ColorIndex = 3 |
|