Copy method on selected dynamic components

Hello, I read the documentations for Selection, Group, and ComponentInstance.
But I can find the copy method only in Group class.
It must be that I’m missing something.

How can I make a copy of selections which are dynamic components?

are you asking for Ruby code or the dynamic component copy attribute?
https://help.sketchup.com/en/sketchup/dynamic-component-predefined-attributes
presumably a dynamic component is a component instance, so the add_instance() method for a component would apply…

The add_instance method adds a component instance to the collection of entities.

2 Likes

With the selection active:

Sketchup.send_action("copy:")

… they will be on the clipboard. Then …

Sketchup.send_action("paste:")

… the copies will now be attached to the mouse. Click somewhere.

2 Likes

Thank you. Your answer was more suitable for my situation.