WISH : "Block instance Base planes by Block Name" component

I’d like to optimize the extraction of block data from my model.
For that, I just need to know the geometry/sub-blocks that are in each blocks definition, and the base plane of each instance.
As it is now, I am forced to reference all the block instances in my model and use “Decompose Block” to get that tree of block instance base planes. This take a LOT of computing time and RAM on large models since it stores all the geometry of all the instances.

The “Reference Block by Name” component is also quite wasteful because it also contains all that geometry data, and does not have a “Base Plane” output.

That’s why I think a “Block instance Base planes by Block Name” component would be quite useful,
as well as the ability to reference the geometry of each block definitions, and not instances.

After all, it’s much closer to the whole idea behind blocks : define geometry once, and from then on, it’s just a buch of lightweigth transform matrices.

Yeah, the only way i know of getting the block name is to Deconstruct, options to just get name or plane would be nice.

I don’t know what you mean by this “ability to reference the geometry of each block definitions, and not instances.”

A block has only one definition, but it can have thousands of instances.
Elefront forces you to reference all the instances which kinds of defeats the purpose of blocks.

By the way, it would also be great to have the GUIDs of all the block instances present in the model, to extract the attributes. Again, no need to carry along all that repeated geometry !

Gotcha, i usually place an temp instance at 0,0,0 or have an attribute to filter my ‘master’ block.

I have a good workflow going, i’ll try to post an comprehensive example here sometime in the next couple weeks.

No, wait ! Just try to be a bit more specific.
I’ll be out of nails to bite in two weeks !

I understand how it can allow you to reference the block’s geometry only once for each block definition, but then, how do you get the transform and attributes of all the instances in your model ?

i think when you use insert block instead of reference block you only get one block which is the definition of it. i am using it that way to avoid referencing all the instances

2 Likes

Hi Ivan, you are right : I can get the geometry for each definition that way.

But it’s no use if I still have to reference all the block instances to get their transforms and attributes !

There is no component that allows this ; therefore, I’m forced to reference all that duplicate geometry with “decompose blocks”.

I know why Elefront didn’t think of this issue : their plugin was never really designed to manage existing blocks, but rather to create blocks from parametrics, and update them eventually.

I’m not blaming them for this, but I’m still stuck !

how about custom script ? tailored for you. get the definition of the block according to its name then transform and replace all the instances…

1 Like

Not sure if I understand…
I don’t need to replace the instances.
I just need to know the transform of each
Instance but without referencing all the duplicate geometry.

What I need is a “Decompose block” without the “Geometry” output, but with an “Attributes” output instead.

EDIT : I think I got it ; three lines of code…

1 Like

Can you tell me what this actually gives you ? I’m,trying to see how I can use this in my work flow…

It outputs the GUI of the Block instances, as well as their transform.
You can also output the insertion point as in the following :
block instance GUID_Transform_InsertionPt.gh (9.8 KB)

Things start te make sense in my head now that I realize that Elefront has it’s special class of objects for storing Blocks.
If my script uses methods from the rhinoCommon “ObjectInstance” class, it won’t work.
Elefron’t blocks are meant to work with Elefront components, and that’s it.

Thankfully, I can reference blocks as “ObjectInstance” objects with Human’s dynamic pipeline :

Now that I understand the basics of RhinoCommon objects and how to call them, I realize I was needlessly trapped in Elefront’s logic, which in fact does not suit my needs.