Set up new entities to group or create a new entites list

In your snippet above, …

… this statement opens an existing .layout document from the C disk drive.

You are confounding 2 separate APIs.
The LayOut API is for working with .layout files that users open in the LayOut application.

Layout::Entity class is 2D and NOT the same as Sketchup::Entity 3D class.
They are saved in different documents (files).

Whenever you make changes to a .layout file (whether new or existing) you need to save it.


I suggest you first learn Ruby, then the SketchUp API, … before you try to tackle the LayOut API.


YES. It is easy.

model = Sketchup.active_model
ments = model.entities
group = ments.add_group
gents = group.entities
# Immediately add a construction point to prevent Ruby garbage collection
cpt = gents.add_cpoint(ORIGIN)
# Now add more entity objects to gents. Erase cpt when done.

YES. You need only have (or find) the reference to the existing group.

There is a very informative topic thread on finding a group by name already …

You can use those examples but substitute a test for your plugin attribute dictionary, if desired.