I am using Rhino + Vray for archiviz. I often have to handle Rhino models that were exported from archicad.
The problem is: almost all archicad elements export as block definitions. It becomes very difficult to assign material to a color, I have to manually _explode and _group each block one by one, to be able to apply my materials according to the color of the objects.
Is there a script or a plug in that could convert all the block to groups?
I found this thread but I don’t know how to use it and it was made in 2010…
I also tried to import the model as IFC using geometrygym, but the results are not perfect and there are some errors with boolean differences between walls and roofs.
Thank you for your help, it would be a game changer for me!
Hi Marie - - here is a very quick and dirty script that should get you what I think you want - nothing fancy here, nested blocks are not in nested groups, you don’t get to name the groups - all possible but… the easy way first.
Thank you for your answer. I tried what you sent me but I think my initial request wasn’t so clear.
I would like to select all blocks in the file, and have them exploded and converted to groups individually.
Basically I don’t want to have block instances anymore in the scene, but groups instead.
What I currently do
I select one block instance
I explode it
I group it
And I repreat the process for all the blocks, one by one.
I am lookign for a script that would do that series of command for each block individually.
Hello Gijs,
I just open a new file and made three blocks out of three boxes. then I ran the script and selected my blocks instances, I pressed enter and skipped the “Press Enter to make a group with one object. Press Enter when done” by pressing enter.
I still have my three blocks by the end of the command.
I don’t want to have blocks anymore but only groups.
Thank you for looking into my request. I really appreciate.
Hi @Marie2 I tested this again, and the script works here as intended.
I created 3 boxes, made 3 blocks out of it. after running the script each block is one extrusion. If I block the 3 blocks into one block, after running the script, I get 1 group with 3 extrusions.
Do you mean that if you look at the properties for each item on screen it is described as a block and not as a group?
Or do you mean that you still see blocks in the Block Manager?
If the former, then please create a file with blocked objects, make a copy of the file and run Pascal’s script on it, then post the two files as ‘before’ and ‘after’.
If the latter then check the count for each block in the block manager and it should be zero because all block instances have been converted to groups. However, while Pascal’s script converts the instances, it doesn’t delete the underlying block geometry. That geometry is not on the drawing canvas (it’s tucked away in a hidden table) and shouldn’t be an issue.
I notice your Rhino is probably French rather than English so it may be simply that it isn’t finding the commands. Try this version instead, which caters for non-English commands: CheapBlocksToGroups2.py (509 Bytes)
If you ever need to run a script on a non-english Rhino then, if it calls a Rhino command, just preface the command name with an underscore (if you open your script in the python editor you can see the two places where I did that).
We perhaps took longer than we should have to see the issue, but that’s really your fault for being so fluent in English that we didn’t make the connection!