Hey @carl,
I have some exciting news to share with you! I did some research on how to send blocks from Grasshopper and it seems that using a combination of Elefront and Speckle can do the trick. Although Grasshopper (for Rhino 7) doesn’t have native block support, Speckle has its own block definition. By using Elefront and Speckle Block objects, we can convert Grasshopper blocks to Speckle blocks and then receive them in Power BI with all their attributes intact. Let me show you how it’s done:
I have created a very simple model with 5 blocks in place.
Creating Speckle Blocks
As you may know, blocks consist of two parts:
- Block definition
- Block Instance
Block Definition
First we need to define a block definition. You can do that by selecting Speckle Schema Object
, which stores all objects part of our library, even those that are not natively available inside Grasshopper.
Then simply search for block and select Block Definition.
Block Definition
expects 3 inputs:
-
name: we can extract this using
Elefront
> Block Explode
node.
-
geometry: again
Elefront
> Block Explode
node.
-
basepoint for the block:
Elefront
> Block Info
node.
Block Instance
Now we have block definition let’s put some instances of it. Again, we will use Speckle Schema Object
Node.
Block Instance
node expects two inputs:
-
block definition: we created one above.
-
transform: we can extract this using Elefront > Block Explode node.
Block Attributes
I also added an additional input to Block Instance node (you can do that by zooming in to the node and click +) for storing attributes. Used AttributesToJSON
node from Elefront
to convert the geometry into JSON.
That’s it! Now simply send it to a Speckle Project and Model of your choice.
Receiving in Power BI
Now, receive this in Power BI and you will receive many blocks.
I filtered out Block Instances from received data and expanded data column.
Converting JSON String into Power BI Record
Elefront Attributes to JSON node converts block attributes to a JSON string. However, its current state is not useful within Power BI. So, let’s parse the JSON into a Power BI Record object to make it more user-friendly.
You can do that by selecting the column, go to Transform > Text Column > Parse > JSON.
Result is a Record
object that is much easier to work with.
Grasshopper File
I have attached the Grasshopper file too. I hope this answers your question.
8534.gh (9.7 KB)