@Michael_Meyer wrote:
Hi...,
sorry, me again.
Can someone show me the way to assign attributes(with material) to existing objects in Python?
# materials are stored in the document's material table index = scriptcontext.doc.Materials.Add() mat = scriptcontext.doc.Materials[index] mat.DiffuseColor = System.Drawing.Color.Chocolate mat.CommitChanges() # set up object attributes to say they use a specific material attr = Rhino.DocObjects.ObjectAttributes() attr.MaterialIndex = index attr.MaterialSource = Rhino.DocObjects.ObjectMaterialSource.MaterialFromObject objects = rhinoscriptsyntax.LastCreatedObjects(); # how to assign attr to objects?
Thanks
Michael
www.flexiCAD.com
Posts: 2
Participants: 2