# How to change object's name in Rhino with GHpython?

**URL:** <https://discourse.mcneel.com/t/how-to-change-objects-name-in-rhino-with-ghpython/52140>\
**Category:** Developer\
**Tags:** ghpython, python\
**Created:** [December 28, 2017, 5:51pm UTC](https://discourse.mcneel.com/t/how-to-change-objects-name-in-rhino-with-ghpython/52140 "2017-12-28T17:51:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RetroPost.LT](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/retropost.lt/32/690596_2.png) [@RetroPost.LT](https://discourse.mcneel.com/u/RetroPost.LT)\
**Post date:** [December 28, 2017, 5:51pm UTC](https://discourse.mcneel.com/t/how-to-change-objects-name-in-rhino-with-ghpython/52140/1 "2017-12-28T17:51:51Z")

</div>

😀Hello All!  
I want to change object’s name directly with GHpython.  
I tried this but failed, after I run this the name didn’t change in rhino:

```auto
import scriptcontext as sc
import Rhino as rh
sc.doc = rh.RhinoDoc.ActiveDoc
obj = sc.doc.Objects.Find(id)
obj.Attributes.Name = "ChangedName"
sc.doc = ghdoc

```

can ghpython achieve this function? That would be very helpful to me.

---

<div class="post-metadata">

**Author:** ![pascal](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/pascal/32/479395_2.png) [@pascal](https://discourse.mcneel.com/u/pascal)\
**Post date:** [December 28, 2017, 6:28pm UTC](https://discourse.mcneel.com/t/how-to-change-objects-name-in-rhino-with-ghpython/52140/2 "2017-12-28T18:28:26Z")

</div>

Hello - it looks like you need to add

`obj.CommitChanges()`

-Pascal

---

<div class="post-metadata">

**Author:** ![RetroPost.LT](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/retropost.lt/32/690596_2.png) [@RetroPost.LT](https://discourse.mcneel.com/u/RetroPost.LT)\
**Post date:** [December 29, 2017, 6:38am UTC](https://discourse.mcneel.com/t/how-to-change-objects-name-in-rhino-with-ghpython/52140/3 "2017-12-29T06:38:48Z")

</div>

That’s it!! Thank you Pascal Golay!
