Metasequoia BBS

| 新規投稿 | 通常表示 | ツリー表示 |
状態
タグ
キーワード
[9674] FILE> EDIT> attribute> selected> object Delete Lines / Delete LINES
対応不要 [要望,help! ] 返信
import MQSystem

doc = MQSystem.getDocument()
objnum = doc.numObject
for oi in range(0, objnum):
    obj = doc.object[oi]
    if obj is None:
        continue


        
    if obj.name == "obj":
        obj.select = 1
        break



hmm i cant find to delete Lines in there :/  so script editor deletes lines for me ! doing script but cant find that one :S
2023-02-13 13:38
[9679] Re: FILE> EDIT> attribute> selected> object Delete Lines / 管理者
Find each face that has two vertices. The pseudo code is thus.

if obj.face[i].numVertex == 2:
   obj.deleteFace(i)
2023-02-14 10:58
[9680] Re: FILE> EDIT> attribute> selected> object Delete Lines / cant mirror in code dsnt let me select mirrored fa
>Find each face that has two vertices. The pseudo code is thus.
>
>if obj.face[i].numVertex == 2:
>   obj.deleteFace(i)


import MQSystem

doc = MQSystem.getDocument()
objnum = doc.numObject
for oi in range(0, objnum):
    obj = doc.object[oi]
    if obj is None:
        continue

    if obj.face[i].numVertex == 2:
           obj.deleteFace(i)


error
Name not found globally.
name 'i' is not defined
2023-02-14 11:15
[9681] Re: FILE> EDIT> attribute> selected> object Delete Lines / 管理者
Don't you understand what 'pseudo code' means?
It doesn't work as is, so you need to make your own improvements to incorporate it.
See more standard samples included in the Script folder.
2023-02-14 14:04