判断一个现有的图层是否可见(正常图层和引用图层都适用)。
rhinoscriptsyntax.IsLayerVisible (layer)
rhinoscript.layer.IsLayerVisible (layer)
layer |
必须参数。字符串或 Guid。现有图层的名称。 |
True |
如果判断成功。 |
False |
如果判断不成功。 |
import rhinoscriptsyntax as rs
layer = rs.GetString("Layer name")
if rs.IsLayer(layer):
if rs.IsLayerVisible(layer): print "The layer is visible"
else: print "The layer is not visible"
else:
print "The layer does not exist."