Blocks in blocks + hiding

I want to implement a means of storing a 3D object with three make2D’s (top, front, right) as a block, but only show the 3D.

When working with the underlying GH tool, only the 3D should be visible, but one of the 2D views of it should be obtained once we make a 2D view of all objects, e.g. a 2D view of a ship with multiple staircases. Sadly, working with different layers and sublayers is not an option -for multiple reasons.

My thought so far was to make a block of blocks, and in this block hide the blocks of all three 2D views. But when I do this, the objects are removed from the block definition, as can bee seen in the figure. Does anybody have a workaround for this, or a recommendation? Possible examplatory code can be given in C#, VB and Python, rhinoscript etc.

Thanks in advance!

You should be able to attach a userDictionary to your geometry using

…Attributes.UserDictionary.Set, maybe you can work around this way.

Hi, thanks for your reply. Can you give me a small example of setting and getting a userdictionairy item to a geometry? I tried some things, but until this moment it remains unclear to me.

Thanks in advance!

Really basic example:
Lets say we have a List<List> named drawings which has all curves for each drawings in a seperate list, and we have a RhinoObject obj which is the obj we want to attach the drawing to.

            for (int i = 0; i < drawings.Count; i++)
                List<Curve> drawing = drawings[i];

                for (int j = 0; j < drawing.Count; j++)
                    obj.Attributes.UserDictionary.Set(string.Format("2D_Drawing_{0}_Curve_{1}", i, j), drawing[j]);

For the first Curve in the first list, this add an entry with the key “2D_Drawing_1_Curve_1” and the curve as the value. Next would be “2D_Drawing_1_Curve_2” and the second curve so you can easily parse each key by the drawing number and then get all curves in a new list in your new file.

1 Like

It’s clear now. Thank you for your help!

You’re welcome, you might want to take a look at this topic for another idea on how to do it.