Plugin for components

Is it possible to make group each surface for the site model with a plugin or a simple solution? And after grouping them individually, extrude all together in random heights?


Joint push/pull can extrude multiple surfaces to randomized lengths.

Thank you, i didn’t realize it works for that but when i’m making each of them group/component, ıs it possible to to this repetitive task with plugin?

You can do it in one step without the need for repetition.

Sketchup.active_model.start_operation "Face2Comp";Sketchup.active_model.active_entities.grep(Sketchup::Face).each{|f| g=Sketchup.active_model.active_entities.add_group(f);g.to_component};Sketchup.active_model.commit_operation
but each component will be unique and will be no better than the original faces since modifying one of them using Push/Pull will not be replicated in the rest.

1 Like

Nice bit of code there Sam, it would be handy if it could be told to ignore the diagonals so you were basically grouping quads.

Here’s a little sample of Sam’s snippet and JPP at work.
They are all separate components, made from each triangle face.
JPP on it’s own can pull them randomly as quads, without making them groups/components.
Code and JPP

mod = Sketchup.active_model
ent = mod.active_entities

ent.grep(Sketchup::Edge).select{|e|e.soft? && e.faces.length==2}.each{|e|g=ent.add_group(e.faces);g.to_component}

will group the two triangles but PushPull still knows it is a surface and will not work. Maybe JPP?