IsBlockInUse

判断一个图块定义是否被图块引例所使用。

语法

rhinoscriptsyntax.IsBlockInUse ( block_name, where_to_look=0 )

rhinoscript.block.IsBlockInUse ( block_name, where_to_look=0 )

参数

block_name

必须参数。字符串。现有图块定义的名称。

where_to_look

可选参数。数字。检验层级:

0 (默认值)

当前文档中的顶层引例。

1

当前文档中的顶层引例及嵌套引例。

2

检查来自其他引例的引用。

返回值

布尔值

True 或 False 表示计算完成或失败。

示例

import rhinoscriptsyntax as rs

strBlock = rs.GetString("Block name")

if rs.IsBlock(strBlock):

    if rs.IsBlockInUse(strBlock):

        print "The block definition is in use."

    else:

        print "The block definition is not in use."

else:

    print "The block definition does not exist."

同见

IsBlock

IsBlockInstance

IsBlockEmbedded

IsBlockReference