# Set Group instance name without making it unique

**URL:** <https://forums.sketchup.com/t/set-group-instance-name-without-making-it-unique/353318>\
**Category:** Ruby API\
**Created:** [December 3, 2026, 3:44pm UTC](https://forums.sketchup.com/t/set-group-instance-name-without-making-it-unique/353318 "2026-12-03T15:44:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryan.moore](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/ryan.moore/32/106089_2.png) [@ryan.moore](https://forums.sketchup.com/u/ryan.moore)\
**Post date:** [December 3, 2026, 3:44pm UTC](https://forums.sketchup.com/t/set-group-instance-name-without-making-it-unique/353318/1 "2026-12-03T15:44:56Z")

</div>

I can manually edit or set copied group instance names without them becoming unique, but using name=(name) makes the group unique. Is there a way to set the group instance name using ruby without making it unique?

---

<div class="post-metadata">

**Author:** ![dezmo](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/dezmo/32/51058_2.png) [@dezmo](https://forums.sketchup.com/u/dezmo)\
**Post date:** [December 3, 2026, 4:14pm UTC](https://forums.sketchup.com/t/set-group-instance-name-without-making-it-unique/353318/2 "2026-12-03T16:14:12Z")

</div>

The answer is in the API documentation:

[Sketchup::Group](https://ruby.sketchup.com/Sketchup/Group.html)

_Groups in SketchUp are very similar to components, but can from a user point of view be thought of as unique objects. Groups can be instanced when copied but are silently made unique when edited through the GUI. To honor this behavior, make sure to call [#make\_unique]_

Furthermore

_The [#make\_unique](https://ruby.sketchup.com/Sketchup/Group.html#make_unique-instance_method "Sketchup::Group#make\_unique (method)") method is used to force a group to have a unique definition. If the group is already unique in the model, nothing happens._

_Copying a group in SketchUp will create a group that shares the same definition. SketchUp implicitly makes group unique when edited from the GUI, and from a user point of view groups could be thought of as always being unique. To honor this behavior, call this method before editing a group through the API._

Then, to provide an answer to specific question:

The [#name=](https://ruby.sketchup.com/Sketchup/Group.html#name=-instance_method "Sketchup::Group#name= (method)") method is used to set the name for the group.

---

<div class="post-metadata">

**Author:** ![ryan.moore](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/ryan.moore/32/106089_2.png) [@ryan.moore](https://forums.sketchup.com/u/ryan.moore)\
**Post date:** [December 3, 2026, 4:54pm UTC](https://forums.sketchup.com/t/set-group-instance-name-without-making-it-unique/353318/3 "2026-12-03T16:54:19Z")

</div>

Thanks Dezmo. I am trying to process groups similar to how Deep Unique processes components. 4 groups share a definition and I want to make 2 of them unique (to a new shared definition, same as initial SketchUp state just severed from the other 2). More plainly - I want sever the selection from the rest of the model cleanly while maintaining the same nesting and definition hierarchy. The only problem I am having is re assigning group instance names that are lost in the process. I was hoping the Ruby API could match SketchUps UI instance naming result (apply the name without making the group unique), but I guess it can’t in this case.

---

<div class="post-metadata">

**Author:** ![DanRathbun](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/danrathbun/32/500_2.png) [@DanRathbun](https://forums.sketchup.com/u/DanRathbun)\
**Post date:** [December 3, 2026, 7:50pm UTC](https://forums.sketchup.com/t/set-group-instance-name-without-making-it-unique/353318/4 "2026-12-03T19:50:28Z")

</div>

The way I see it, the instance [`#name=`](https://ruby.sketchup.com/Sketchup/Group.html#name=-instance_method) method should act only upon the group instance and be distinct from the definition’s [`name=`](https://ruby.sketchup.com/Sketchup/ComponentDefinition.html#name=-instance_method) method.

Meaning that I would expect groups at the top level to **not** be made unique simply by changing their instance name property.

But this goes “out the window” when dealing with nested groups. Changing a property for a nested group instance changes it in all parent entities because they share the same instance.

> [@ryan.moore](#):
>
> 4 groups share a definition and I want to make 2 of them unique (to a new shared definition, same as initial SketchUp state just severed from the other 2).

Well you could make the 3rd unique, then **replace** the 4th with an instance of the 3rd’s definition. Your code would need to copy all properties and attribute dictionaries (if any.)

---

<div class="post-metadata">

**Author:** ![ryan.moore](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/ryan.moore/32/106089_2.png) [@ryan.moore](https://forums.sketchup.com/u/ryan.moore)\
**Post date:** [December 3, 2026, 9:37pm UTC](https://forums.sketchup.com/t/set-group-instance-name-without-making-it-unique/353318/5 "2026-12-03T21:37:52Z")

</div>

Hey Dan. 👋

> [@DanRathbun](#):
>
> Well you could make the 3rd unique, then **replace** the 4th with an instance of the 3rd’s definition. Your code would need to copy all properties and attribute dictionaries (if any.)

Yes this is what I have done. But naming the copy forks it to a new definition. An example script:

```ruby
model = Sketchup.active_model
ents = model.active_entities
model.start_operation('name probe', true)
g1 = ents.add_group
g1.entities.add_face([0,0,0], [10,0,0], [10,10,0], [0,10,0])
g2 = ents.add_instance(g1.definition, Geom::Transformation.new([20,0,0]))
p g2.class # Sketchup::Group
p g1.definition == g2.definition # true, shared
g2.name = 'Leg'
p g1.definition == g2.definition # false, renaming forked it
model.abort_operation

```

---

<div class="post-metadata">

**Author:** ![DanRathbun](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/danrathbun/32/500_2.png) [@DanRathbun](https://forums.sketchup.com/u/DanRathbun)\
**Post date:** [December 3, 2026, 11:19pm UTC](https://forums.sketchup.com/t/set-group-instance-name-without-making-it-unique/353318/6 "2026-12-03T23:19:20Z")

</div>

OK, I see what you see. I tested back to SU2024 and also 2017.

I believe this should be a bug, as there is no API contract that the `name=` instance method should internally call `#make_unique`. It is also unexpected as well as (in most cases) undesirable.

---

<div class="post-metadata">

**Author:** ![ryan.moore](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/ryan.moore/32/106089_2.png) [@ryan.moore](https://forums.sketchup.com/u/ryan.moore)\
**Post date:** [December 4, 2026, 4:25am UTC](https://forums.sketchup.com/t/set-group-instance-name-without-making-it-unique/353318/7 "2026-12-04T04:25:06Z")

</div>

OK thanks Dan, I’ve filed it on the API issue tracker:

[https://github.com/SketchUp/api-issue-tracker/issues/1125](https://github.com/SketchUp/api-issue-tracker/issues/1125)
