Placing Blocks in Grasshopper with correct units

I’m having a bit of frustration due to placing blocks using grasshopper.

I developed a GH program that inserts blocks using Elefront’s Insert Block component and places them on a facade through a series of transformations. I used this program successfully for one project and am now trying to apply to a new project. I created the various block components that I would need in an empty Rhino file that had its Units set to Feet. So, for example, I made a block called Window01 that had dimension 2’ x 10’.

I then brought these block definitions into the main project file and set up my GH file that inserts the blocks. However, the blocks once placed were much smaller than they were supposed to be. This is because the file has its Units set to Inches. So, when my Window01 block was placed, it was in the correct position and orientation, but sized at 2" x 10". Now, when I place Window01 in Rhino without GH, simply using the Insert command, the block is correctly sized at 24" x 120".

Also, I tested this with Human’s Place Block component and had the same problem.

In this case, the problem is easily solved by setting the file Units to Feet and then working from there. But I am hoping to develop a program that can be readily attached to many different files, and use any block definition. If these are out of alignment, that could be a real headache. I know Grasshopper is generally considered a unitless application, but is there a work around for this? Rhino automatically knows to convert 2’ to 24" when I use Insert, so how can I get that same functionality in GH?

Hi - You can access the Rhino document’s units setting through a C# or Python script on the Grasshopper canvas and use that information to base the rest of your logic on.

Ok - it seems there is no quick solution to this, I’ll just hope it doesn’t become more of an issue. The Rhino document’s units are readily accessible, but to do proper conversions I would need to know all the blocks’ intended units as well. So the question is, do blocks have units associated with them, or not? If not, I would have to know the intended units of all the blocks I was working with ahead of time and put that information in grasshopper, so that I could perform the proper scaling on each block as I inserted it into the document. Could be annoying if I am working with many blocks from different sources with different intended units.

Again, do block definitions have units, and can that be accessed in Grasshopper? Or, alternatively, can the block’s units be changed in the Rhino document, without manually scaling each block and re-saving the definition. I have searched for a definitive statement on this and found nothing.

The only other investigation into this question that I’ve found is this thread [here]. It was inconclusive.

Yes, they do. I’m not sure if you can access this information through code - @dale might know.
We have an open YT issue where scaling of blocks is discussed. This item is currently on the “Future” list: RH-28728.