# about rename

**URL:** https://forum.highend3d.com/t/about-rename/61042
**Category:** Xsi
**Tags:** developers
**Created:** [December 22, 2002, 1:14pm UTC](https://forum.highend3d.com/t/about-rename/61042 "2002-12-22T13:14:42Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![door](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/d/b4bc9f/32.png) [@door](https://forum.highend3d.com/u/door)
#### Post date: [December 22, 2002, 1:14pm UTC](https://forum.highend3d.com/t/about-rename/61042/1 "2002-12-22T13:14:42Z")

</div>

hi i am a beginner

i want to rename 5 sphere  
i try to write a simple code,like this:

Set oRoot=ActiveSceneRoot  
Set oSel=Application.Selection  
For Each oItem in oSel  
oItem.Name=“aaa”  
Next

’ Output of above script:  
'INFO : “aaa”  
'INFO : “aaa1”  
'INFO : “aaa2”  
'INFO : “aaa3”  
'INFO : “aaa4”

but i want their name is: aaa01,aaa02,aaa03,aaa04,aaa05

how to do that?thx:)

---

<div class="post-metadata">

### Author: ![steve3d](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/s/6de8d8/32.png) [@steve3d](https://forum.highend3d.com/u/steve3d)
#### Post date: [December 22, 2002, 2:47pm UTC](https://forum.highend3d.com/t/about-rename/61042/2 "2002-12-22T14:47:54Z")

</div>

try this:(javascript)  
oRoot=ActiveSceneRoot;  
oSel=Application.Selection;  
for(i=0;i oSel(i).Name=“aaa0”+i

so simple ha ![](http://64.32.63.100/forums/icons/laugh.gif)

---

<div class="post-metadata">

### Author: ![door](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/d/b4bc9f/32.png) [@door](https://forum.highend3d.com/u/door)
#### Post date: [December 22, 2002, 3:12pm UTC](https://forum.highend3d.com/t/about-rename/61042/3 "2002-12-22T15:12:56Z")

</div>

i got it ![](http://64.32.63.100/forums/icons/laugh.gif)

oRoot=ActiveSceneRoot  
Set oSel=Selection  
Dim i  
i=0  
for Each oItem in oSel  
oItem.Name=“aaa0”&i  
i=i+1  
next

---

<div class="post-metadata">

### Author: ![door](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/d/b4bc9f/32.png) [@door](https://forum.highend3d.com/u/door)
#### Post date: [December 22, 2002, 3:32pm UTC](https://forum.highend3d.com/t/about-rename/61042/4 "2002-12-22T15:32:31Z")

</div>

but still have a problem…

if i have 100 sphere,i want their name : aaa00~aaa99  
how to do this?..

---

<div class="post-metadata">

### Author: ![door](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/d/b4bc9f/32.png) [@door](https://forum.highend3d.com/u/door)
#### Post date: [December 23, 2002, 11:13am UTC](https://forum.highend3d.com/t/about-rename/61042/5 "2002-12-23T11:13:30Z")

</div>

![](http://64.32.63.100/forums/icons/smile.gif)OK

oRoot=ActiveSceneRoot  
Set oSel=Selection  
Dim i  
i=0  
for Each oItem in oSel  
if i\<10 then  
oItem.Name=“aaa0”&i  
else  
oItem.Name=“aaa”&i  
end if  
i=i+1  
next
