Get Usertext from object in a Block

Yes and no. I can get access to the usertext:

go = Rhino.Input.Custom.GetObject()
#insert script to run your GetObject command
objref = go.Object(0)      #Output from the GetObject command
part = objref.ObjectId
if rs.IsBlockInstance(part):
    part = objref.InstanceDefinitionPart()
part = str(rs.coerceguid(part))
attids = rs.GetUserText(part)

My current issue is that I’m using Linked blocks and when the linked block is updated the GUIDs get screwed up in my working model and I lose the link to the object in the block. I haven’t tried recently so maybe there has been a change to how blocks are handled but right now I’m assuming it is still a problem. (As an aside if you can use a worksession then the links work)

Ian

2 Likes