Read inserted block scale

Hi,
If I have a file with multiple blocks scaled in random factors, can I read the scaling factor somewhere?

I tried _what, but I don’t know exactly how to read Transformation data, it stops making sense when I rotate the block.

Thanks
Jonas

Hi Jonas - looks like GH can help - it has a component for that - I’ll see if I can make it do something useful in this case.

-Pascal

Are you sure about that? Last I checked GH couldn’t read blocks with a plug-in, and being able to back out scale fromm the transformation matrix according to Dale is cumbersome. I wish Rhino would have stored each transformation of a given block so it would be easier reset certain ones without affecting the others.

Well, it has a component, yes, but that only spits out the numbers in the matrix, it does not extract the individual transforms, so, back to the drawing board.

Here’s a python that maybe gets it right - give it a spin -
@djnelson75, @Jonish

ExtractInstanceScaling.py (639 Bytes)

-Pascal

1 Like

Thanks I will give it a shot. Where in GH do you find the ability to reference blocks? I must be missing something.

Hi Dennis, I used a GUID component, and a python component to get the matrix from the object-

image

-Pascal

1 Like

Ahh I see. Thanks.

Do I need to download some Python plugin or can it be done via C#?

Thanks
J

Hi J - I’m sure that py file is easy to translate to c#… it’s only a few lines. You can test using
RunPythonScript

or

! -RunPythonScript "Full path to py file inside double-quotes"

If you need it in GH, the same code should work fine in a script component.

GetBlockInstanceScaling.gh (11.6 KB)

-Pascal

Thank Pascal, I guess that solves it. I’m surprised it’s that hard to find out a block scaling factor.

Cheers
Jonas

The python script seems to work for backing out the scaling factor, what if you wanted to find the rotation. How would you go about finding out those values?

Hi Dennis - it’s a little more complicated but possible, I think, I just have not been able to get to it.

-Pascal

I would look into Elefront, which lets you extract block base plane.

Something like…

does not seem to work now

FWIW, in Rhino 8, the scale of a block instance can be read and changed from the Properties panel:

-wim

1 Like

Hello Wim, what about mirror? People sometimes mirror blocks by accident, then stuff goes to production and everyone is surprised. Being able to look for mirrored blocks using command / grasshopper nodes / side panel would be super useful.

Cheers
Jonas

1 Like

Hi Jonas -

Yes. It doesn’t make sense to me that block instances can be scaled or mirrored without forcing a new definitions, but such is life… At least being able to see the state would be good.
RH-72547 Blocks: Show mirrored state
-wim

1 Like

i dont understand, if there is scale -1 on an axis then it is mirrored. what more do you want to be able to see?

Hi Ivan -

Who’s asking for more ways to see? A way would be nice.
-wim

If it worked this way and if it was accessible from Rhino, that would be 100% sufficient for me.

_SelMirroredBlocks would also be nice.

1 Like