test.3dm (31.2 KB)
I hope I’m not doing something obviously wrong here, I’m new to rhino3dm.
Running this code here with the attached model file:
import rhino3dm as r
model = r.File3dm.Read('test.3dm')
objTable = model.Objects
for obj in objTable:
geom = obj.Geometry
print("<<< All user strings: ", geom.GetUserStrings() , " Type string: ", geom.GetUserString( "type" ), " User string count: ", geom.UserStringCount, " >>>" )
The output is this, despite the fact that the single surface in the model does in fact have several pieces of user text attached:
<<< All user strings: () Type string: User string count: 0 >>>
If I set user text in the code before printing it works fine.
Added line:
geom.SetUserString( "type", "Frame web" )
Result is then:
<<< All user strings: ((‘type’, ‘Frame web’),) Type string: Frame web User string count: 1 >>>