[pycad]抛砖、续貂之cad零基础二开自用:选择集改色
# 枫叶版pycad 感谢飞狐,山人,枫叶,闻人南的示例
#让pycad不放弃每一个打螺丝人
@Command()
def changeColor21(doc): #选择集改色
with dbtrans(doc) as tr:
ss = ssget()
# ss = ssget_x(filters=(conv.Or, (conv.And, (0, 'LWPOLYLINE'),(8, 'asdfa') ) ,(conv.And, (0, 'line'), (8, 'asdfa') ) ) ) #选择集组合条件过滤
# ss = ssget_x(filters=((-4, '>'), (40, 80), (-4, '<'), (40, 90) ) ) #大于 小于 不等于
if not ss.ok:
return
idss = tuple(ss)
for objid in idss:
obj = tr.getobject(objid, acdb.OpenMode.ForWrite)
obj.ColorIndex = 3
页:
[1]