# Read inserted block scale

**URL:** <https://discourse.mcneel.com/t/read-inserted-block-scale/56530>\
**Category:** Rhino for Windows\
**Created:** [March 2, 2018, 7:05pm UTC](https://discourse.mcneel.com/t/read-inserted-block-scale/56530 "2018-03-02T19:05:43Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonish](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jonish/32/772327_2.png) [@Jonish](https://discourse.mcneel.com/u/Jonish)\
**Post date:** [March 2, 2018, 7:05pm UTC](https://discourse.mcneel.com/t/read-inserted-block-scale/56530/1 "2018-03-02T19:05:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pascal](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/pascal/32/479395_2.png) [@pascal](https://discourse.mcneel.com/u/pascal)\
**Post date:** [March 2, 2018, 7:10pm UTC](https://discourse.mcneel.com/t/read-inserted-block-scale/56530/2 "2018-03-02T19:10:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![djnelson75](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/djnelson75/32/683971_2.png) [@djnelson75](https://discourse.mcneel.com/u/djnelson75)\
**Post date:** [March 2, 2018, 9:43pm UTC](https://discourse.mcneel.com/t/read-inserted-block-scale/56530/3 "2018-03-02T21:43:44Z")

</div>

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.

> [@Transformation Matrix](https://discourse.mcneel.com/t/transformation-matrix/3446/8):
>
> There is no perfect way. For example, certain scale operations rotation operations can cause the scale and rotation components of the transform will become mixed. Here are a couple of sample routines I wrote some time ago. They are fairly rudimentary. If you know that your transform only has particular types of component transforms inside it and if you’re willing to accept the fact that you won’t get an exact version of those transforms back after decomposition, they might work for you.

---

<div class="post-metadata">

**Author:** ![pascal](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/pascal/32/479395_2.png) [@pascal](https://discourse.mcneel.com/u/pascal)\
**Post date:** [March 2, 2018, 10:19pm UTC](https://discourse.mcneel.com/t/read-inserted-block-scale/56530/4 "2018-03-02T22:19:43Z")

</div>

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](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/8/3/83d9d9e8cc3e24f98be242caba29f4f79ded7d65.py) (639 Bytes)

-Pascal

---

<div class="post-metadata">

**Author:** ![djnelson75](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/djnelson75/32/683971_2.png) [@djnelson75](https://discourse.mcneel.com/u/djnelson75)\
**Post date:** [March 2, 2018, 10:39pm UTC](https://discourse.mcneel.com/t/read-inserted-block-scale/56530/5 "2018-03-02T22:39:45Z")

</div>

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

 ![2018-03-02%2014_39_09-Grasshopper%20-%20unnamed](https://global.discourse-cdn.com/mcneel/original/3X/a/c/acae7ba932bbfba9606559192ff209f0369bb00e.png)

---

<div class="post-metadata">

**Author:** ![pascal](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/pascal/32/479395_2.png) [@pascal](https://discourse.mcneel.com/u/pascal)\
**Post date:** [March 2, 2018, 10:43pm UTC](https://discourse.mcneel.com/t/read-inserted-block-scale/56530/6 "2018-03-02T22:43:01Z")

</div>

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

 ![image](https://global.discourse-cdn.com/mcneel/original/3X/3/e/3e24b4487cd67e90b88d7bfa1a095e956b05ac5e.png)

![image](https://global.discourse-cdn.com/mcneel/original/3X/b/5/b5c7249dff8ffa0233ba63ea9f5d1c3a6b99e29a.png)

-Pascal

---

<div class="post-metadata">

**Author:** ![djnelson75](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/djnelson75/32/683971_2.png) [@djnelson75](https://discourse.mcneel.com/u/djnelson75)\
**Post date:** [March 2, 2018, 10:46pm UTC](https://discourse.mcneel.com/t/read-inserted-block-scale/56530/7 "2018-03-02T22:46:39Z")

</div>

Ahh I see. Thanks.

---

<div class="post-metadata">

**Author:** ![Jonish](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jonish/32/772327_2.png) [@Jonish](https://discourse.mcneel.com/u/Jonish)\
**Post date:** [March 2, 2018, 10:53pm UTC](https://discourse.mcneel.com/t/read-inserted-block-scale/56530/8 "2018-03-02T22:53:35Z")

</div>

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

Thanks  
J

---

<div class="post-metadata">

**Author:** ![pascal](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/pascal/32/479395_2.png) [@pascal](https://discourse.mcneel.com/u/pascal)\
**Post date:** [March 2, 2018, 10:55pm UTC](https://discourse.mcneel.com/t/read-inserted-block-scale/56530/9 "2018-03-02T22:55:43Z")

</div>

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](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/d/2/d28025cc44eb49bf1694ad372bab875b7d85af71.gh) (11.6 KB)

-Pascal

---

<div class="post-metadata">

**Author:** ![Jonish](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jonish/32/772327_2.png) [@Jonish](https://discourse.mcneel.com/u/Jonish)\
**Post date:** [March 4, 2018, 7:29pm UTC](https://discourse.mcneel.com/t/read-inserted-block-scale/56530/10 "2018-03-04T19:29:12Z")

</div>

> [@pascal](#):
>
> ExtractInstanceScaling.py (639 Bytes)

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

Cheers  
Jonas

---

<div class="post-metadata">

**Author:** ![djnelson75](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/djnelson75/32/683971_2.png) [@djnelson75](https://discourse.mcneel.com/u/djnelson75)\
**Post date:** [March 13, 2018, 10:01pm UTC](https://discourse.mcneel.com/t/read-inserted-block-scale/56530/11 "2018-03-13T22:01:05Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![pascal](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/pascal/32/479395_2.png) [@pascal](https://discourse.mcneel.com/u/pascal)\
**Post date:** [March 13, 2018, 10:04pm UTC](https://discourse.mcneel.com/t/read-inserted-block-scale/56530/12 "2018-03-13T22:04:38Z")

</div>

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

-Pascal

---

<div class="post-metadata">

**Author:** ![Jonish](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jonish/32/772327_2.png) [@Jonish](https://discourse.mcneel.com/u/Jonish)\
**Post date:** [March 14, 2018, 8:43am UTC](https://discourse.mcneel.com/t/read-inserted-block-scale/56530/13 "2018-03-14T08:43:06Z")

</div>

> [@djnelson75](#):
>
> what if you wanted to find the rotation

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

Something like…

 ![V%C3%BDst%C5%99i%C5%BEek](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/6/a/6a186b639ca46a8a2e8cb100801d7d92f8dd261b.JPG)

---

<div class="post-metadata">

**Author:** ![ivan.galik](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/ivan.galik/32/731821_2.png) [@ivan.galik](https://discourse.mcneel.com/u/ivan.galik)\
**Post date:** [January 19, 2023, 9:30am UTC](https://discourse.mcneel.com/t/read-inserted-block-scale/56530/14 "2023-01-19T09:30:36Z")

</div>

does not seem to work now

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/d/d/2/dd23b096e42880377282e0f96095b8938cb6b04f.jpeg)

---

<div class="post-metadata">

**Author:** ![wim](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/wim/32/747482_2.png) [@wim](https://discourse.mcneel.com/u/wim)\
**Post date:** [January 20, 2023, 8:06am UTC](https://discourse.mcneel.com/t/read-inserted-block-scale/56530/15 "2023-01-20T08:06:52Z")

</div>

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

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/f/b/2/fb25fc1e70cccb7e9d9ac079754d2ccfca86d5d6.jpeg)

-wim

---

<div class="post-metadata">

**Author:** ![Jonish](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jonish/32/772327_2.png) [@Jonish](https://discourse.mcneel.com/u/Jonish)\
**Post date:** [January 20, 2023, 8:27am UTC](https://discourse.mcneel.com/t/read-inserted-block-scale/56530/16 "2023-01-20T08:27:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![wim](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/wim/32/747482_2.png) [@wim](https://discourse.mcneel.com/u/wim)\
**Post date:** [January 20, 2023, 9:08am UTC](https://discourse.mcneel.com/t/read-inserted-block-scale/56530/17 "2023-01-20T09:08:17Z")

</div>

Hi Jonas -

> [@Jonish](#):
>
> what about mirror?

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](https://mcneel.myjetbrains.com/youtrack/issue/RH-72547) Blocks: Show mirrored state  
-wim

---

<div class="post-metadata">

**Author:** ![ivan.galik](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/ivan.galik/32/731821_2.png) [@ivan.galik](https://discourse.mcneel.com/u/ivan.galik)\
**Post date:** [January 20, 2023, 9:36am UTC](https://discourse.mcneel.com/t/read-inserted-block-scale/56530/19 "2023-01-20T09:36:41Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![wim](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/wim/32/747482_2.png) [@wim](https://discourse.mcneel.com/u/wim)\
**Post date:** [January 20, 2023, 10:13am UTC](https://discourse.mcneel.com/t/read-inserted-block-scale/56530/20 "2023-01-20T10:13:12Z")

</div>

Hi Ivan -

> [@ivan.galik](#):
>
> what more do you want to be able to see?

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

---

<div class="post-metadata">

**Author:** ![Jonish](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jonish/32/772327_2.png) [@Jonish](https://discourse.mcneel.com/u/Jonish)\
**Post date:** [January 20, 2023, 10:31am UTC](https://discourse.mcneel.com/t/read-inserted-block-scale/56530/21 "2023-01-20T10:31:11Z")

</div>

> [@ivan.galik](#):
>
> 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?

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

\_SelMirroredBlocks would also be nice.

[Next page](https://discourse.mcneel.com/t/read-inserted-block-scale/56530.md?page=2)
