Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5938

Is this the best way to automatically update linked blocks?

$
0
0

@Holo wrote:

Blockmanager isn't very effective in updating blocks so I wrote a small script,
but does this seem like the most reliable and effective way to do so?

import rhinoscriptsyntax as rs

blockList=rs.BlockNames()

if blockList:
    n=0
    nn=0
    
    for block in blockList:
        status=rs.BlockStatus(block)
        if status==-3:
            n=n+1
        if status==1:
            nn=nn+1
            print ("Updating "+str(block) )
            rs.Command("-BlockManager _Update "+str(block)+" _Enter")
    
    print "File has "+str(len(blockList) - n )+" linked blocks, "+str(nn)+" updated"

print "File has "+str(len(blockList) - n )+" linked blocks, "+str(nn)+" updated"

Posts: 5

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 5938

Trending Articles