Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5875

rhinoscriptcontext.AddMaterialToObject(object_id) purges UserText

$
0
0

@Willem wrote:

Hi,

I found that after running rhinoscriptcontext.AddMaterialToObject(object_id) to add a material to an object, all it’s Usertexts are purged:

import rhinoscriptsyntax as rs


id = rs.AddLine([0,0,0] , [1,1,1])

rs.SetUserText(id, 'foo', 'bar')


print 'foo value : {}'.format(rs.GetUserText(id, 'foo'))

rs.AddMaterialToObject(id)

print 'foo value : {}'.format(rs.GetUserText(id, 'foo'))

printout:
foo value : bar
foo value : None

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 5875

Trending Articles