# Component/instance same name?

**URL:** <https://forums.sketchup.com/t/component-instance-same-name/51547>\
**Category:** Pro\
**Created:** [September 14, 2017, 7:29am UTC](https://forums.sketchup.com/t/component-instance-same-name/51547 "2017-09-14T07:29:19Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![corey.lafaei](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/corey.lafaei/32/37702_2.png) [@corey.lafaei](https://forums.sketchup.com/u/corey.lafaei)\
**Post date:** [September 14, 2017, 7:29am UTC](https://forums.sketchup.com/t/component-instance-same-name/51547/1 "2017-09-14T07:29:19Z")

</div>

Good Morning,

I’m not sure if anyone can help me…

I’ve started using sketchup pro 2017 to make gaming maps, where I export them as .vmf files and then import to hammer.

I need a work around where I can call components the same names for example a square callled ENT\_info\_player\_start and a cylinder called ENT\_info\_player\_start. I need them to have the same name.

I’ve added some pictures of this where it says it’ll be replaced. Is there a work around to tell sketchup not todo this.

Thanks

 ![IMG_2915](https://global.discourse-cdn.com/sketchup/original/3X/9/2/9215d78331bb9a811ce1abf389443b4e9f6307b5.JPG)

---

<div class="post-metadata">

**Author:** ![Wo3Dan](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/wo3dan/32/7450_2.png) [@Wo3Dan](https://forums.sketchup.com/u/Wo3Dan)\
**Post date:** [September 14, 2017, 7:53am UTC](https://forums.sketchup.com/t/component-instance-same-name/51547/2 "2017-09-14T07:53:28Z")

</div>

> [@corey.lafaei](#):
>
> … where it says it’ll be replaced. Is there a work around to tell sketchup not todo this.

Replacing can be stopped by quitting the ‘Make Component’ operation. That’s not much of an option, I know.  
But each component ( **definition** ) name is unique. There can’t be two different components having the same definition.  
Each component also has a ‘Name’ field that you can name anything you like. So different components, whether copy instances or completely different in geometry (with different **definition** names) can be named the same.

---

<div class="post-metadata">

**Author:** ![corey.lafaei](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/corey.lafaei/32/37702_2.png) [@corey.lafaei](https://forums.sketchup.com/u/corey.lafaei)\
**Post date:** [September 14, 2017, 7:58am UTC](https://forums.sketchup.com/t/component-instance-same-name/51547/3 "2017-09-14T07:58:02Z")

</div>

Okay, so if I name them different things could the Definition remain the same?

---

<div class="post-metadata">

**Author:** ![eneroth3](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/eneroth3/32/1222_2.png) [@eneroth3](https://forums.sketchup.com/u/eneroth3)\
**Post date:** [September 14, 2017, 8:04am UTC](https://forums.sketchup.com/t/component-instance-same-name/51547/4 "2017-09-14T08:04:23Z")

</div>

The instance name can be the same on multiple instances but the definition name can never be the same on multiple definitions. The definition name is the reference to the component definition, similarly to how a file path is the reference to a file. No two files can have the same path and no two definitions can have the same name.

---

<div class="post-metadata">

**Author:** ![Wo3Dan](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/wo3dan/32/7450_2.png) [@Wo3Dan](https://forums.sketchup.com/u/Wo3Dan)\
**Post date:** [September 14, 2017, 8:05am UTC](https://forums.sketchup.com/t/component-instance-same-name/51547/5 "2017-09-14T08:05:43Z")

</div>

No. Different geometry grouped as components have different **definition** names. The names can be the same though.  
I’ve said this before, the ‘Create Component’ window is confusing in that it doesn’t say **definition** where it should.  
See the ‘Entity Info’ when having a component selected. You can change its name any thing you like. But the definition is unique.

---

<div class="post-metadata">

**Author:** ![eneroth3](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/eneroth3/32/1222_2.png) [@eneroth3](https://forums.sketchup.com/u/eneroth3)\
**Post date:** [September 14, 2017, 9:00am UTC](https://forums.sketchup.com/t/component-instance-same-name/51547/6 "2017-09-14T09:00:56Z")

</div>

> [@Wo3Dan](#):
>
> I’ve said this before, the ‘Create Component’ window is confusing in that it doesn’t say definition where it should.

Can’t agree. The make component window should say name because it’s the name of the definition. The Entity Info should really say Definition Name and Instance Name because that what it refers to. The current labels are just confusing and suggest you can swap definition by writing the name of a different one.

---

<div class="post-metadata">

**Author:** ![spawn](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/spawn/32/37792_2.png) [@spawn](https://forums.sketchup.com/u/spawn)\
**Post date:** [September 14, 2017, 9:16am UTC](https://forums.sketchup.com/t/component-instance-same-name/51547/7 "2017-09-14T09:16:34Z")

</div>

I’m getting mixed up with all those terms 😄

---

<div class="post-metadata">

**Author:** ![corey.lafaei](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/corey.lafaei/32/37702_2.png) [@corey.lafaei](https://forums.sketchup.com/u/corey.lafaei)\
**Post date:** [September 14, 2017, 12:12pm UTC](https://forums.sketchup.com/t/component-instance-same-name/51547/8 "2017-09-14T12:12:28Z")

</div>

Okay that makes sense, is there a way I can force it to have the same name? Like making two files have the same address. Atm I having to export it into hammer and change all of definitions to the same name manually in a sense doing it twice.

---

<div class="post-metadata">

**Author:** ![Wo3Dan](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/wo3dan/32/7450_2.png) [@Wo3Dan](https://forums.sketchup.com/u/Wo3Dan)\
**Post date:** [September 14, 2017, 12:18pm UTC](https://forums.sketchup.com/t/component-instance-same-name/51547/9 "2017-09-14T12:18:12Z")

</div>

> [@Wo3Dan](#):
>
> I’ve said this before, the ‘Create Component’ window is confusing in that it doesn’t say definition where it should.
> 
> See the ‘Entity Info’ when having a component selected. You can change its name any thing you like. But the definition is unique.

Oops, I never noticed that SU2017 has definition in its ‘Create Component’ window now, unlike in earlier versions, (SU2015 and before). I can’t check version SU2016 now.  
And in SU2017 in ‘Entity Info’ you can change the definition (a unique name) and also name the instances of components.  
It’s an improvement although now new users may wonder what to enter for the definition for newly created components. Definition name and Instance name would have been better but I guess its a matter of saving space in these windows.

---

<div class="post-metadata">

**Author:** ![MikeWayzovski](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/mikewayzovski/32/98346_2.png) [@MikeWayzovski](https://forums.sketchup.com/u/MikeWayzovski)\
**Post date:** [September 14, 2017, 12:52pm UTC](https://forums.sketchup.com/t/component-instance-same-name/51547/10 "2017-09-14T12:52:54Z")

</div>

> [@Wo3Dan](#):
>
> Oops, I never noticed that SU2017 has definition in its ‘Create Component’ window now, unlike in earlier versions, (SU2015 and before). I can’t check version SU2016 now.

Yes, starting since version 2017, the entity info is also making a distinction between instance and definition

![37](https://global.discourse-cdn.com/sketchup/original/3X/5/1/51487f0228e68fc3fb3026a297e4429e8c9988c4.png)

 ![](https://global.discourse-cdn.com/sketchup/original/3X/b/9/b9f2f5bdaa04cebb1927645ac6ceb65d7063f22b.gif)

---

<div class="post-metadata">

**Author:** ![eneroth3](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/eneroth3/32/1222_2.png) [@eneroth3](https://forums.sketchup.com/u/eneroth3)\
**Post date:** [September 14, 2017, 1:41pm UTC](https://forums.sketchup.com/t/component-instance-same-name/51547/11 "2017-09-14T13:41:27Z")

</div>

I don’t think you understand what a definition name is. Two different places can’t both have the same address, two different people can’t have the same social security number, two different days can’t have the same date etc; that’s not how it works.

What are definition names used for when you are exporting? It seams like the same string is used for a completely separate field in that data format.

---

<div class="post-metadata">

**Author:** ![corey.lafaei](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/corey.lafaei/32/37702_2.png) [@corey.lafaei](https://forums.sketchup.com/u/corey.lafaei)\
**Post date:** [September 14, 2017, 4:12pm UTC](https://forums.sketchup.com/t/component-instance-same-name/51547/12 "2017-09-14T16:12:58Z")

</div>

I’m using hammer it’s a 3D source software. The definitions were are the codes for the game so ENT\_info\_player\_start is. A starting point. It there are others like ENT\_function\_door. And each geometry is different. The great thing with sketch up is its more user friendly than hammer.

---

<div class="post-metadata">

**Author:** ![corey.lafaei](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/corey.lafaei/32/37702_2.png) [@corey.lafaei](https://forums.sketchup.com/u/corey.lafaei)\
**Post date:** [September 14, 2017, 4:15pm UTC](https://forums.sketchup.com/t/component-instance-same-name/51547/13 "2017-09-14T16:15:20Z")

</div>

There are loads of commands but the definitions are all the same.

---

<div class="post-metadata">

**Author:** ![eneroth3](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/eneroth3/32/1222_2.png) [@eneroth3](https://forums.sketchup.com/u/eneroth3)\
**Post date:** [September 14, 2017, 4:44pm UTC](https://forums.sketchup.com/t/component-instance-same-name/51547/14 "2017-09-14T16:44:08Z")

</div>

That is not what a definition in SketchUp is. Each definition in SketchUp _must_ have its own name to distinguish it from other definitions. I haven’t used hammer in years and never imported SketchUp models to it so I don’t know how that process works. However it seems like hammer uses the phrase definition for something completely different, something that much more resembles a layer in SketchUp than a definition name.

---

<div class="post-metadata">

**Author:** ![eneroth3](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/eneroth3/32/1222_2.png) [@eneroth3](https://forums.sketchup.com/u/eneroth3)\
**Post date:** [September 14, 2017, 4:51pm UTC](https://forums.sketchup.com/t/component-instance-same-name/51547/15 "2017-09-14T16:51:39Z")

</div>

I don’t have hammer installed on this computer. Could you share a printscreen of the window that lets you define an object as ENT\_info\_player, ENT\_func\_door etc?

---

<div class="post-metadata">

**Author:** ![corey.lafaei](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/corey.lafaei/32/37702_2.png) [@corey.lafaei](https://forums.sketchup.com/u/corey.lafaei)\
**Post date:** [September 14, 2017, 8:52pm UTC](https://forums.sketchup.com/t/component-instance-same-name/51547/16 "2017-09-14T20:52:58Z")

</div>

The Definition name in sketchup relates to the class name in hammer.  
So I need to have the same for things like doors, buttons, actions etc. which in sketch up all start ENT\_  
then the hammer class reads anything after ENT\_.

 ![skeychammer](https://global.discourse-cdn.com/sketchup/original/3X/e/3/e3317be49da0881bc9c0a16119889c70a84d504e.PNG)

---

<div class="post-metadata">

**Author:** ![eneroth3](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/eneroth3/32/1222_2.png) [@eneroth3](https://forums.sketchup.com/u/eneroth3)\
**Post date:** [September 15, 2017, 7:00am UTC](https://forums.sketchup.com/t/component-instance-same-name/51547/17 "2017-09-15T07:00:26Z")

</div>

If definition name maps to class names there seems to be something wrong with the exporter/importer you are using. Maybe the people who created it didn’t know what either a definition name in SU or a class name in hammer means. In hammer there can be multiple different looking doors, right?

Maybe the exporter/importer only fallbacks to using the definition name if the instance name field is empty. Have you tried giving the component an instance name?

---

<div class="post-metadata">

**Author:** ![MikeWayzovski](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/mikewayzovski/32/98346_2.png) [@MikeWayzovski](https://forums.sketchup.com/u/MikeWayzovski)\
**Post date:** [September 15, 2017, 7:32am UTC](https://forums.sketchup.com/t/component-instance-same-name/51547/18 "2017-09-15T07:32:08Z")

</div>

> [@eneroth3](#):
>
> Have you tried giving the component an instance name?

or just use named groups instead of components?

---

<div class="post-metadata">

**Author:** ![corey.lafaei](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/corey.lafaei/32/37702_2.png) [@corey.lafaei](https://forums.sketchup.com/u/corey.lafaei)\
**Post date:** [September 15, 2017, 7:49am UTC](https://forums.sketchup.com/t/component-instance-same-name/51547/19 "2017-09-15T07:49:48Z")

</div>

I haven’t tried either of those. I will have a look and let you know 🙂

---

<div class="post-metadata">

**Author:** ![TIG](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/tig/32/198_2.png) [@TIG](https://forums.sketchup.com/u/TIG)\
**Post date:** [September 15, 2017, 9:15am UTC](https://forums.sketchup.com/t/component-instance-same-name/51547/20 "2017-09-15T09:15:04Z")

</div>

OR perhaps if the exporter is using the component-instance name - which defaults to “” - this snippet when run in the Ruby Console [copy+paste+enter] will rename all component-instances to match their definition-name…  
That might fix things ?

```
m=Sketchup.active_model;m.start_operation("inamer",true);m.definitions.each{|d|next if d.group? || d.image?;d.instances.each{|i|i.name=d.name}};m.commit_operation;

```

It is one step undo-able.

[Next page](https://forums.sketchup.com/t/component-instance-same-name/51547.md?page=2)
