# Block Instance Problem

**URL:** <https://discourse.mcneel.com/t/block-instance-problem/99492>\
**Category:** Rhino for Windows\
**Tags:** rhino6\
**Created:** [April 4, 2020, 2:47pm UTC](https://discourse.mcneel.com/t/block-instance-problem/99492 "2020-04-04T14:47:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![greatsaiyamandbz](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/greatsaiyamandbz/32/293373_2.png) [@greatsaiyamandbz](https://discourse.mcneel.com/u/greatsaiyamandbz)\
**Post date:** [April 4, 2020, 2:47pm UTC](https://discourse.mcneel.com/t/block-instance-problem/99492/1 "2020-04-04T14:47:24Z")

</div>

Hello All,

I have a simple query. I know that if we create a box and made a block instance out of it and copy paste say 100 times in some random position, and if we change one the box rest will change.

But is it possible if 100 boxes are already created and we can somehow make block instance and connect everything and do the above steps the same?

---

<div class="post-metadata">

**Author:** ![Mahdiyar](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/mahdiyar/32/472862_2.png) [@Mahdiyar](https://discourse.mcneel.com/u/Mahdiyar)\
**Post date:** [April 4, 2020, 3:16pm UTC](https://discourse.mcneel.com/t/block-instance-problem/99492/2 "2020-04-04T15:16:43Z")

</div>

It’s possible to write a script to check geometries equality and then create a block instance and replace all equal geometry with that block. It would be easy for Boxes but not as simple for other geometries.

---

<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:** [April 4, 2020, 4:37pm UTC](https://discourse.mcneel.com/t/block-instance-problem/99492/3 "2020-04-04T16:37:01Z")

</div>

Hello - see the attached script - if the geometry is truly copies of an original, it ought to work.

[ReplaceWithBlocked.py](https://discourse.mcneel.com/uploads/short-url/yrWKLO2aZOYSHRQFuOOTSr8OzpA.py) (2.7 KB)

To use the Python script use `RunPythonScript`, or a macro:

`_-RunPythonScript "Full path to py file inside double-quotes"`

-Pascal

---

<div class="post-metadata">

**Author:** ![greatsaiyamandbz](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/greatsaiyamandbz/32/293373_2.png) [@greatsaiyamandbz](https://discourse.mcneel.com/u/greatsaiyamandbz)\
**Post date:** [April 8, 2020, 6:25am UTC](https://discourse.mcneel.com/t/block-instance-problem/99492/4 "2020-04-08T06:25:35Z")

</div>

sorry for the late reply,

I got this message when I used your script

![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/8/6/86ad4abb2882a21846a465be41e901ff5e2a10f5.png)

step 1: I have many boxes, so I chose one box and made it as block and edited that block

step 2: I ran the script and I chose the block and I chose target object and the above message pops up in my window

kindly help on how to resolve this

---

<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:** [April 8, 2020, 4:03pm UTC](https://discourse.mcneel.com/t/block-instance-problem/99492/5 "2020-04-08T16:03:31Z")

</div>

Hello - this is a very stupid script, I made it for someone’s very specific case - if the objects are not actually copies of an original, it is unlikely to work, and it does not work on extrusions - only breps and meshes. The error you see looks like you have selected an extrusion - I can filter for that and probably even make it work but right now it does not.

If that does not explain things, please send me an example file.

-Pascal
