返回一个物件上记录的用户文本。更多关于用户数据的信息,请参考 用户数据方法 。
rhinoscriptsyntax.GetUserText (object_id, key=None, attached_to_geometry=False)
rhinoscript.userdata.GetUserText (object_id, key=None, attached_to_geometry=False)
object_id |
必须参数。字符串或 Guid。物件的 ID 。 |
||||||
key |
可选参数。字符串。键名。如果省略或指定空字符串 ("") ,将返回物件上记录的所有键名。 |
||||||
attached_to_geometry |
可选参数。布尔值。读取
|
字符串 |
如果指定了 key 参数,返回其相关值。 |
列表 |
如果没有指定 key 参数,返回键名列表。 |
None |
如果执行不成功或出错,返回空值。 |
import rhinoscriptsyntax as rs
obj = rs.GetObject("Select object")
if obj:
print rs.GetUserText(obj, "PartNo")
print rs.GetUserText(obj, "Price")