Quantcast
Channel: Rhino Developer - McNeel Forum
Viewing all articles
Browse latest Browse all 8530

Assign object to layer by Layer Name

$
0
0

@Stroopwafelandcoffee wrote:

I’m trying to assign an object to a Layer by using the layer name, but I’m so far not able to get it done, the best example I can find:

But that uses the layer index. In my case I have just created the layer and given it a name:

for item in items:
    itemObject = importRhinoFile(item)
    itemName = item.replace(".3dm","",1)
    itemName = itemName.replace("Base","",1)
    itemLayer = Rhino.DocObjects.Layer()
    itemLayer.Name = itemName
    sc.doc.Layers.Add(itemName)

I would now like to assign the item with itemName to the layer with the same name. Is this possible?

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 8530

Trending Articles