Exploding question

Hi everyone,
I have a question if there is a way to expolde nested components one level down only if it is made of components and when it is component that contains only geometry and group than it stays unexploded ?
something like the op_flatten hierarchy plugin but the plugin also exoldes nested groups component.
any help would be appreciated.
Thank you Miroslav

It’s relatively straightforward…

The container.explode operation returns an array of the entities it results in.

Write a method that can be iterated…

Use it to explode the ‘container’ by passing a reference.
You then grep the returned array to collect any previously nested groups and component-instances, then pass those back into the method as an argument… and repeat until the grepped array is finally empty…

thanks @DanRathbun I will check it out. This morning i actually woke up with a brain storm and manage to modify the op_flatten hierarchy and got what a needed. I know I shouldnd do it but I will use for my own purposes. I even tried to contact the author but no respond from him.

:grin: yeah when I was 16 years old I thought I am the navel of the world. meaning that I can do anything I want easy. now iam 40 and it makes me smile.

thanks @tig @DanRathbun for your plugins it is actualy not what i was after.
for my work flow i have created plugin optimik export that exports all hardwear, profiles an boards to cut optimazing software called OPTIMIK. I mean created as i paid somebody to write a plugin exactly as i needed it. (my ruby knowledge is very poor and seems almost impossible for me to learn it just from the internet) . the pluging reads only components because than i could use groups to create component that can change and the optimik export plugin woul recogniye only the component.
i will try to explain what i do .

the main wraper is cabinet that contains boards like sides , top and bottom and back. thees are also components made from groups . the groups are just to show me by colour which side of board is edge banding applied.
next hardwear like hinges. i use wraper component for hinges that contains component hinges made of raw geometry. so than witin the wraper i can dynamicaly copy , position the hinges and give them name and to on.

but i need the hindges an boards Components only not the wrappers for the export. so thats why i need to explode the wrapper to components but the components stay unexploded if they are made of raw geometry and groups. considering that the wrappers are also a components.
i have to doubleclick to open the cabbinet to select all of the wrappers and components and than explode to just components.
i try to show you in short video cause it is no easy to explain it for me. thanks

https://aws1.discourse-cdn.com/sketchup/original/3X/9/6/9639b4ad9d4f5c70ae8f2c60e9f3de2693dd6d41.mp4

But the code i have modified is working well only if i open the cabinet and select all inside and than expole.
the best way for me would be, if i didnt have to open the main wrapper cabinet component and just select it and the code would explode everithing inside just to components and the cabinet would stayunexploded wrapper. thanks again. hope one day i wil find the way to learn to do so.

okay, then good luck. Maybe you’ll find someone who can understand. I can’t.

Hi Pupokveta,

Could you give us a view of what is inside the SU Outliner or uploading a model here ? We’ll get a better view of how your model is structured. Your video doesn’t really help to understand what the OPTIMIK plugin is generating.

Then could you try, based on the given model, to tell us exactly what groups and/or components (not clear for me as well) should be exploded using a ruby script ?

@milmandre thanks I knew it would not be easy to describe what I am after. :blush:
I had to hit the road today for some project maesurings so I will try again when I get back. thanks