How do I pass attributes from input geometry using Rhino.Geometry.Unroller() onto unfolded objects?

Like UnrollSrf command does to curves, breps and Dots?

I need unrolled points to inherit the attr’s of their inputs and Dots to keep their colors.

Hi @Asterisk,

Does this example help?

SampleUnroller.py

– Dale

1 Like

It looks like it should, but I get this error:

Message: 'type' object has no attribute '__index__'

Traceback:
line 42, in SampleUnroller

EDIT: Had to restart Rhino.

Something’s missing there:

As I understand, points can’t be handled the same way?..

        if curves:
            rev = len(curves) - 1
            for j in range(len(curves)):
                attr = sc.doc.CreateDefaultAttributes()
                print unroll.FollowingGeometryIndex(curves[j])
                if unroll.FollowingGeometryIndex(curves[j]) >= 0:
                    attr = panelcrvs[rev - j].Attributes
                    attr.RemoveFromAllGroups()
                    sc.doc.Objects.Add(curves[j], attr)

image

It seems that Unroller enumerates unrolled curves in reverse order, which is easy to fix.
But dots are enumerated in some random order and I have no clue how to fix it.

Hi @Asterisk,

TextDot objects seems to unroll in selected order (see attached 3dm file). I used the SampleUnroller.py script I referenced above.

SampleUnroller.3dm (85.2 KB)

What am I missing?

– Dale

The problem is that mine aren’t manually selected. I click the “panel” which has everything needed to be unrolled grouped and script sifts thru group members building lists of curves, and dots. Curves it handles in sensible order, but dots are random. I’m missing something that UnrollSrf command does that our script doesn’t in regards of ordering dots (input order =! output order).



Rename zip to mkv:
2021-03-16 20-21-25.zip (6.0 MB)

Hi @Asterisk,

TextDot inherits from GeometryBase. Thus you can attached all sort of user data/text on one of these that will help you track tehse in the manner you need.

– Dale

1 Like

Got it! So, if I want all attribute User Text values passed onto unrolled objects, I just need to duplicate them in Geometry User Text?

Hex yeah. Thanks Dale!

It would still be nice if dots order wasn’t fubared during unroll. :wink: