I have some sections views that I want to turn off the “Display Model” properties, so it will only show annotations. Is there a node that can do that?
An alternative would be changing this setting on the view template, but I couldn’t find a node to do that either!
import clr
import sys
import System
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
toList = lambda x : x if hasattr(x, '__iter__') else [x]
#Preparing input from dynamo to revit
lstView = toList(UnwrapElement(IN[0]))
#Do some action in a Transaction
TransactionManager.Instance.EnsureInTransaction(doc)
for v in lstView:
paraDMode = v.get_Parameter(BuiltInParameter.VIEW_MODEL_DISPLAY_MODE)
#0 -> Normal
#1 -> half tone
#2 -> do not display
paraDMode.Set(2)
TransactionManager.Instance.TransactionTaskDone()
OUT = lstView