I’d like to access the keys and values of the attribute user text for each of several geometries on different layers as shown below.
May I ask what RhinoCommon class/property/method I should use? Thanks.
get_user_text_attrib.gh (6.7 KB)
b02.3dm (146.2 KB)
Gijs
(Gijs de Zwart)
3
import Rhino
def getKeysAndValues():
filter = Rhino.DocObjects.ObjectType.AnyObject
rc, objref = Rhino.Input.RhinoGet.GetOneObject("", False, filter)
if not objref or rc != Rhino.Commands.Result.Success:
return
keys = objref.Object().Attributes.GetUserStrings()
for key in keys:
value = objref.Object().Attributes.GetUserString(key)
print key +":"+ value
getKeysAndValues()
2 Likes