C# setting view scale

I’ve been trying to use BuiltInParameter.VIEW_SCALE
But I couldn’t change the scale of my elevations.

So I’ve resorted to using a look up Parameter scaleParam = view.LookupParameter("View Scale");

The look up works.. But I’m wondering if you can use the built in parameter and it’s my poor coding or if there’s something else.

If using revit 2023+, try using the forgetypeid approach. Generally works for me.

2 Likes

It’s for Revit 2025.

Do forgeTypeIds get the type rather than the individual element?

I want to set the View Scale of individual views.

In this case forgetypeid represents the parameter that it can get from an element or element type (as an element). Should work in 2025.

You can use the Scale property directly

2 Likes

Oh wow, that was a LOT shorter.

I went from:

            Parameter scaleParam = view.LookupParameter("View Scale");
            if (scaleParam != null && !scaleParam.IsReadOnly)
            {
                scaleParam.Set(70); 
            }

to:

view.Scale = 70;

I am using scale of 70 as a test because it’s obviously a stupid scale that’d not occur normally :smiley:

2 Likes

Haha yep that made a big difference… much easier than my rabbit hole approach!