2011/08/24

ウェイトが100でないポイントを選択する

調べたいオブジェクトを選択して、実行です。


l=list()
for i,w in enumerate(Application.Selection(0).Envelopes(0).Weights):
    if round(sum(w),5)!=100:
        l.append(i)

Application.SelectGeometryComponents(Application.Selection(0).FullName+".pnt["+",".join(map(str,l))+"]")


内包表記を使うと1行で出来たよ。


Application.SelectGeometryComponents(Application.Selection(0).FullName+".pnt["+",".join([ str(i) for i,w in enumerate(Application.Selection(0).Envelopes(0).Weights) if round(sum(w),5)!=100])+"]")

0 件のコメント:

Perforce: 複数のワークスペースを更新するバッチ

batを叩けば全部更新。 @echo off set P4PORT=x.x.x.x:xxxx set P4USER=user set P4PASSWD=password echo %P4PORT% echo %P4USER% echo %P4PASSWD% echo %P4PAS...