SR12 - Parent Layer Bug?

Still seems to be broken in Rhino 6.

But you can use rs.ParentLayer() to change the parent instead.

The original code from the first post seems to work here in V6 SR4:

import rhinoscriptsyntax as rs
print "New layer:", rs.AddLayer("MyLayer3")
print "New layer:", rs.AddLayer("MyLayer4",parent="MyLayer3")

MyLayer4 is added as the child of MyLayer3.

What are you seeing that is different?

I see the problem now, seems to be when its inside of EnabeRedraw()

import rhinoscriptsyntax as rs

rs.EnableRedraw(False)
print "New layer:", rs.AddLayer("MyLayer3")
print "New layer:", rs.AddLayer("MyLayer4",parent="MyLayer3")
rs.EnableRedraw(True)

Returns:
New layer: MyLayer3
New layer: MyLayer4

And strangely, after running this same code enough (edit: 10 times), the layers eventually properly nest.

But if I close and reopen rhino, the problem begins again.

Sorry, the EnableRedraw is not the problem. The same problem persists without it. It’s all about having a newly opened rhino file.

I ran it in a newly opened Rhino file each time. Once with Rhino in English, once in French, and once in German. They all worked…

Just tried on another computer at the office and it did not have this problem either.

Both have the same, latest version (Version 6.3.18090.471) of Rhino (both english). Both have ironpython 2.7.7, but the machine with the problem is windows 10, while the other is windows 7.

I can confirm that this problem does show up every now and then. We have not found a way to reproduce it reliably. As a workaround, I code with full layer paths such as ‘parent::child’

1 Like

I can’t reproduce this :frowning: