# Space.Number and Space Level is returning a diferente number than where he actualy is

**URL:** <https://forum.dynamobim.com/t/space-number-and-space-level-is-returning-a-diferente-number-than-where-he-actualy-is/91073>\
**Category:** Revit\
**Tags:** revit, python, dynamo\
**Created:** [June 23, 2023, 9:33am UTC](https://forum.dynamobim.com/t/space-number-and-space-level-is-returning-a-diferente-number-than-where-he-actualy-is/91073 "2023-06-23T09:33:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![miguel.bc.silvestre](https://avatars.discourse-cdn.com/v4/letter/m/ebca7d/32.png) [@miguel.bc.silvestre](https://forum.dynamobim.com/u/miguel.bc.silvestre)\
**Post date:** [June 23, 2023, 9:33am UTC](https://forum.dynamobim.com/t/space-number-and-space-level-is-returning-a-diferente-number-than-where-he-actualy-is/91073/1 "2023-06-23T09:33:39Z")

</div>

Hi there,

Im runing a dynamo script where i need to get the level and division number of the all elements in revit project.  
Everything works fine, except for one element ( Thermostat) , where to location outputed is clearing not where it is

i write this example code see display 2 ways of how i get the level and division number (both give the same result):

> elems = IN[1]
> 
> for e in elems:
> 
> ```
> if e.GetFamily.Name.lower() == "LE_Generic_Thermostat":
> 
> # first method 
> space = e.get_Space()
> level = s.GetParameterValueByName("Level")
> print(level)
>     
> # second method 
> space = UnwrapElement(space)
> print(space.Level.Name, " | ",space.Number)
> 
> ```

the output is this:

> -1  
> -1 | 4

And the location should be level : 0 and division: 7

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/8/68cf849540335ed6d3c4c1ccb17387031ef50108.png)

This is a strange error , because the location in all elements is correct except on this one, why?  
When i run the multi-category schedule, I get the correct level , which means the problem is in the dynamo python function, right?

Here is a screenshot of the multi-category-schedule:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/e/3e2a252e41ed3a6e70ee018968df647d7480296d.jpeg)

Does anyone have a clue of why is this happening, or have a solution?  
Any feedback would be great

Thanks

---

<div class="post-metadata">

**Author:** ![Revit\_Noob](https://avatars.discourse-cdn.com/v4/letter/r/a587f6/32.png) [@Revit\_Noob](https://forum.dynamobim.com/u/Revit_Noob)\
**Post date:** [June 23, 2023, 9:51am UTC](https://forum.dynamobim.com/t/space-number-and-space-level-is-returning-a-diferente-number-than-where-he-actualy-is/91073/2 "2023-06-23T09:51:28Z")

</div>

See if this helps :

> [@Elements in Room vs Elements in Space](https://forum.dynamobim.com/t/elements-in-room-vs-elements-in-space/75381/6):
>
> Hello the problem is that spaces have the same name Try this version of “Elements in Space” #Copyright(c) 2015, Konrad Sobon # @arch\_laboratory, http://archi-lab.net # This code is based on Family.InRoom node originally created # by Peter Kompolschek and published on Dynamo blog. Big thanks # to Peter for sharing his work so graciously. # modified by Cyril Poupin import clr import sys clr.AddReference('ProtoGeometry') from Autodesk.DesignScript.Geometry import \* pyt\_path = r'C:\Program F…

I am also trying to get the space name and number into a family and this node works for me in sample revit project…

but when i tried it in real time “big” project…it’s not returning the proper space name and number…

following your thread maybe this will help me as well…
