# Rename and Number elements by Level

**URL:** <https://forum.dynamobim.com/t/rename-and-number-elements-by-level/37704>\
**Category:** Revit\
**Created:** [June 28, 2019, 3:35am UTC](https://forum.dynamobim.com/t/rename-and-number-elements-by-level/37704 "2019-06-28T03:35:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AnimationSB](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@AnimationSB](https://forum.dynamobim.com/u/AnimationSB)\
**Post date:** [June 28, 2019, 3:35am UTC](https://forum.dynamobim.com/t/rename-and-number-elements-by-level/37704/1 "2019-06-28T03:35:56Z")

</div>

Good day fellow Dynamo Users

We currently have a project with a tight deadline, and require a Dynamo script to speed up the process, if this idea is possible thru Dynamo.

The target is to rename and number all the elements for 4 different categories, numbering them from 1 onwards with a 3 digit padding (0001, 0002, …)

The elements need to be numbered, however, from left to right and from bottom to top (by level)

I am sure nodes such as Select.ByCategoryAndLevel will be used for the selection part, and we will be setting the name using Element.SetParameterByName but I am not sure exactly how to pull off the LeftToRight and BottomToTop selection as well setting the incrementing numbers to these.

---

<div class="post-metadata">

**Author:** ![Matthew.Pettengell](https://avatars.discourse-cdn.com/v4/letter/m/e99b99/32.png) [@Matthew.Pettengell](https://forum.dynamobim.com/u/Matthew.Pettengell)\
**Post date:** [June 28, 2019, 3:42am UTC](https://forum.dynamobim.com/t/rename-and-number-elements-by-level/37704/2 "2019-06-28T03:42:07Z")

</div>

Should be possible, at least in theory…

Have you attempted to get the Location Points of the Elements and then order them by that?

---

<div class="post-metadata">

**Author:** ![AnimationSB](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@AnimationSB](https://forum.dynamobim.com/u/AnimationSB)\
**Post date:** [June 28, 2019, 3:59am UTC](https://forum.dynamobim.com/t/rename-and-number-elements-by-level/37704/3 "2019-06-28T03:59:46Z")

</div>

Thank you, will look into that aspect of Revit. I’m actually the post-prod artist here, assisting the Revit teams who are loaded with projects. Still learning and familiarizing myself with both Revit and Dynamo as I go.

---

<div class="post-metadata">

**Author:** ![AnimationSB](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@AnimationSB](https://forum.dynamobim.com/u/AnimationSB)\
**Post date:** [June 28, 2019, 9:18am UTC](https://forum.dynamobim.com/t/rename-and-number-elements-by-level/37704/4 "2019-06-28T09:18:21Z")

</div>

This threat and script in theory, should be the solution

> [@Rename elements (beams,columns etc.) by X and Y direction](https://forum.dynamobim.com/t/rename-elements-beams-columns-etc-by-x-and-y-direction/9186/21):
>
> @imran_raj1985 Slightly altered. Should work fine now [renumber\_framing-20170209.dyn](https://forum.dynamobim.com/uploads/short-url/41D6G7RKa9p4mvcyxCXhmI3QGib.dyn) (28.2 KB)

It worked for the OP there but results in an error when I tried

 ![Location%20Error](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/1/711ab782c862e30d4d33bcf0eeaab9a2c5d3ba64.png)  
That thread was closed so I am not able to ask about it.

---

<div class="post-metadata">

**Author:** ![Bjorn\_Keulemans1](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/bjorn_keulemans1/32/54676_2.png) [@Bjorn\_Keulemans1](https://forum.dynamobim.com/u/Bjorn_Keulemans1)\
**Post date:** [June 28, 2019, 10:14am UTC](https://forum.dynamobim.com/t/rename-and-number-elements-by-level/37704/5 "2019-06-28T10:14:35Z")

</div>

A FamilyInstance Node will not work on a Revit System Family element. There should be something like element.getlocation or something similarly named.

Also if you need to number Walls (and other non-point placed elements) think hard about how you are going to define the order of longer/shorter/overlapping elements. Finding the Start or End or Mid etc?
