Change scale display name

Is it possible to active and set the scale display name? Don’t know why Revit lookup indicated the parameter is read only while the value can be modify manually.
nts-1

First of all. Apologies for reviving this 2.5 year old thread. But, I stumbled on this while messing with it too.


The actual BuiltInParameter name is VIEW_SCALE_CUSTOMNAME, and the below python should do it:

# Load the Python Standard and DesignScript Libraries
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

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

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

viewports = UnwrapElement(IN[0])
override = IN[1]

TransactionManager.Instance.EnsureInTransaction(doc)
params = []
for v in viewports:
	pa = v.get_Parameter(BuiltInParameter.VIEW_SCALE_CUSTOMNAME)
	pa.Set(override)
	params.append(pa)
	
TransactionManager.Instance.TransactionTaskDone()

# Assign your output to the OUT variable.
OUT = viewports```

---

I found this using the button on the bottom left of Revit Lookup, built In Enums snoop
4 Likes

HI John,
Apologies for saying thanks late. need to change 50+ views to NTS today, and remeber this forgotten thread. I order to display custom name, BuiltInParameter.VIEW_SCALE_HAVENAME need set to 1

v.get_Parameter(BuiltInParameter.VIEW_SCALE_HAVENAME).Set(1);

Thank you so much!

1 Like

That’s awesome! Glad it helped out. :raised_hands:

Hey guys, just found this thread as I also have a ton of views to change scale names on. @glenncai I see your response about needing to add the “view_scale_havename” parameter. My question is where did you add the in the python script above?

right after set VIEW_SCALE_CUSTOMNAME parameter
pa = v.get_Parameter(BuiltInParameter.VIEW_SCALE_CUSTOMNAME)
pa.Set(“Custom View Scale Name”)
v.get_Parameter(BuiltInParameter.VIEW_SCALE_HAVENAME).Set(1)

So, I have the code loaded into a Python script, however it fails when I run it. Below is the code:

# Load the Python Standard and DesignScript Libraries
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

# The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN

# Place your code below this line

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

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

viewports = UnwrapElement(IN[0])
override = IN[1]

TransactionManager.Instance.EnsureInTransaction(doc)
params = []
for v in viewports:
	pa = v.get_Parameter(BuiltInParameter.VIEW_SCALE_CUSTOMNAME)
	pa.Set(“Custom View Scale Name”)
	v.get_Parameter(BuiltInParameter.VIEW_SCALE_HAVENAME).Set(1)
	
TransactionManager.Instance.TransactionTaskDone()

# Assign your output to the OUT variable.
OUT = viewports```

Any ideas as to why it’s failing?

Hi, Sorry for late reply. your code work fine for me, What error message did you get?

Hey, I needed to change the display name for approx. 300 drafting views today and this is what worked for me: