Minor bug in AddLayer if parent and no color

Hi guys, for some reason this doesn’t make B a child of A:

import rhinoscriptsyntax as rs
rs.AddLayer("A")
rs.AddLayer("B", parent="A")

but this does:

import rhinoscriptsyntax as rs
rs.AddLayer("A")
rs.AddLayer("B", color=(255,0,255), parent="A")

So not adding a color messes something up.

Cheers

Hi Jørgen,

rs.AddLayer("A")
rs.AddLayer("B", parent="A")

seems to be working here…

image

On my end, you are both right.
It seems to be working on Rhino 6 but not the Rhino 7 WIP. Is that where you were trying this, Jørgen?
-wim

I tried in both… I maybe don’t have the latest WIP though.
Edit - just WIP’ed up the latest version - and it still works here…

image

image

image

Now updated both Rhino versions to the latest BOTD and running from a factory-default template, using the same script in both versions (saved to disk in RH6 and opened in RH7)
image

Now, this does not work in Rhino 6 but works fine in Rhino 7

(6.23.20008.15521, 01/08/2020)

image

(7.0.20009.2435, 2020-01-09)

image

Then, shutting down and relaunching Rhino 6 with different templates a couple of time, this now works fine again. I dunno…
-wim

1 Like

Thanks for looking into it.
Strange stuff, I’ll judt add colors as I don’t have time to bugtrack :slight_smile:
Oh, and I was on v6.

I can’t reproduce this on v6 or v7 with different templates. @wim, if you can reproduce this again let me know.

@Alain, I can’t reproduce this now. Unassigning you but will report back when I see this again…
-w

FWIW …

I use a script with AddLayer() every day on Rhino 6.
Usually it works, but ‘sometimes’ it fails.
I have not been able to understand when/why … :confused:

EDIT:

I mean: setting a parent layer sometimes fails.
The layer is always created.

2 Likes