I am wanting to remove a view template from existing views. I couldn’t find a node that did this so attempted to write some python coding to perform this task. I am getting an error saying that the integer value that I am trying to write the -1 to is read only.
Is there an easy way of doing this using nodes or what am I missing in my python coding?
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
#The inputs to this node will be stored as a list in the IN variables.
views=UnwrapElement(IN[0])
elementlist=list()
for i in views:
i.ViewTemplateId.IntegerValue = -1
elementlist.append(i.ViewTemplateId.IntegerValue)
#Assign your output to the OUT variable.
OUT = elementlist