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

[Python] getting the name of sub-blocks

$
0
0

@ivelin.peychev wrote:

this doesn’t work. I get just the name of the master-block

import rhinoscriptsyntax as rs

block_uuid = rs.GetObjects("Select Block(s): ",rs.filter.instance)

for block_id in block_uuid:
    block_name = rs.ObjectName(block_id)
    
    sub_blocks_ids = rs.BlockObjects(block_name)
    #print sub_blocks_ids
    
    for sub_block_id in sub_blocks_ids:
        sub_block_name = rs.ObjectName(sub_block_id)
        print sub_block_name
        if sub_block_name is None:
            break

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 5938

Trending Articles