# View Scale Name

**URL:** <https://forum.dynamobim.com/t/view-scale-name/35733>\
**Category:** Revit\
**Created:** [May 9, 2019, 12:30am UTC](https://forum.dynamobim.com/t/view-scale-name/35733 "2019-05-09T00:30:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![PR\_matthew.terry](https://avatars.discourse-cdn.com/v4/letter/p/b487fb/32.png) [@PR\_matthew.terry](https://forum.dynamobim.com/u/PR_matthew.terry)\
**Post date:** [May 9, 2019, 12:30am UTC](https://forum.dynamobim.com/t/view-scale-name/35733/1 "2019-05-09T00:30:08Z")

</div>

I am trying to extract the view scale name of view, but everything I try just outputs the scale ratio instead. Is there a way to extract the view scale name? It looks like it is an option when I list out the element parameters.

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

---

<div class="post-metadata">

**Author:** ![SeanP](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/seanp/32/42560_2.png) [@SeanP](https://forum.dynamobim.com/u/SeanP)\
**Post date:** [May 9, 2019, 4:14am UTC](https://forum.dynamobim.com/t/view-scale-name/35733/2 "2019-05-09T04:14:10Z")

</div>

See here, maybe will help you out.

> [@Get/Set View Scale](https://forum.dynamobim.com/t/get-set-view-scale/10112):
>
> Hi I am trying to set the view scale in a newly duplicated sheet, but this Sheet.GetViewports node isnt working. So I dont seem to be able to even get the view scale from a view. Is this even possible? Or is it not exposed in the Revit API? Thanks

FYI: the parameter Vale as you show per the API is an integer.

---

<div class="post-metadata">

**Author:** ![jonathan.ochse](https://avatars.discourse-cdn.com/v4/letter/j/977dab/32.png) [@jonathan.ochse](https://forum.dynamobim.com/u/jonathan.ochse)\
**Post date:** [May 9, 2019, 4:34am UTC](https://forum.dynamobim.com/t/view-scale-name/35733/3 "2019-05-09T04:34:15Z")

</div>

Hi there Matthew,

This workflow worked for me. I opted for a different way of selecting all the views from the project. Your method of selection also worked.

Views that have no scale, such as perspective views don’t report anything but the script still works.

 ![DYN%20Example](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/8/18eb3440e20470ec0dbdb53d582412216e37157e.png)

---

<div class="post-metadata">

**Author:** ![PR\_matthew.terry](https://avatars.discourse-cdn.com/v4/letter/p/b487fb/32.png) [@PR\_matthew.terry](https://forum.dynamobim.com/u/PR_matthew.terry)\
**Post date:** [May 9, 2019, 9:24am UTC](https://forum.dynamobim.com/t/view-scale-name/35733/4 "2019-05-09T09:24:22Z")

</div>

What I am trying to get is the view scale name (the scale display name), i.e. 6" = 1’-0", 1/8" = 1’-0"… not the scale ratio. You can see in my first post that the element.parameters node does list the view scale (6" = 1’-0") so it must be possible. However when you try to get that parameter information is just reports the scale ratio.

I have some custom scales with custom display names in a project and I want to be able to extract that information.

---

<div class="post-metadata">

**Author:** ![Brendan\_Cassidy](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/brendan_cassidy/32/7685_2.png) [@Brendan\_Cassidy](https://forum.dynamobim.com/u/Brendan_Cassidy)\
**Post date:** [May 9, 2019, 9:35am UTC](https://forum.dynamobim.com/t/view-scale-name/35733/5 "2019-05-09T09:35:07Z")

</div>

This is because the parameter in dynamo is giving you the “AsInteger” value not the “AsValueString”. There may be examples of how to get this from a parameter on the forum to help you, just do a search for “AsvalueString parameter”.

I have just looked at a view via the revit lookup and this is how the information is stored within revit.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/4/d4a6784bbe171ffad7b9a68994fa6c042842c1c2.png)

---

<div class="post-metadata">

**Author:** ![walraven.timo](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/walraven.timo/32/72764_2.png) [@walraven.timo](https://forum.dynamobim.com/u/walraven.timo)\
**Post date:** [May 9, 2019, 10:10am UTC](https://forum.dynamobim.com/t/view-scale-name/35733/6 "2019-05-09T10:10:33Z")

</div>

In addition to what Brendan said, copy/paste this into a python code node. This will work with a flat list of views.

```
import System
from System.Collections.Generic import *

import clr
clr.AddReference('RevitAPI') 
from Autodesk.Revit.DB import *

views = UnwrapElement(IN[0])

out = []
for i in views:
    out.append(i.LookupParameter("View Scale").AsValueString())

 OUT = out
```

---

<div class="post-metadata">

**Author:** ![PR\_matthew.terry](https://avatars.discourse-cdn.com/v4/letter/p/b487fb/32.png) [@PR\_matthew.terry](https://forum.dynamobim.com/u/PR_matthew.terry)\
**Post date:** [May 9, 2019, 5:41pm UTC](https://forum.dynamobim.com/t/view-scale-name/35733/7 "2019-05-09T17:41:56Z")

</div>

Thank you both that solved the problem and the python scrip worked perfectly.
