Hi, SketchUp community!
This is my first time posting here, so I apologise for any beginner mistakes!
I am currently working on my first plugin - a timber framing tool that generates a frame based on a predefined/ pre-modelled wall face.
I’ve seen and tried Meedek’s plugin, which is simply amazing but does not quite work for my very specific workflow.
At the moment I am in the process of frame generation and stumbled across the .subtract(group) method which would be ideal to split frames at locations of window/doors etc.
When subtracting one group from another, it will leave two parts of the frame, which I would need to group into two separate groups. The screenshots below show the process using .subtract(group) as explained on the API Documentation. The last screenshot would be the desired end result - both objects grouped together individually.
entities = Sketchup.active_model.entities
group1 = entities[0]
group2 = entities[1]
result = group1.subtract(group2)
I can’t seem to find an easy method/solution to select and group each individual object to be put into an array which I could then use in another method to modify these groups. (Or I have not found the right one yet!)
Any advice would be much appreciated!
-Laurin