Change Section View Detail Level from Coarse to Medium

Hi guys
I’m trying to get my dynamo script to change the Detail Level of Section View from Coarse to Medium. This looks like the wrong way to go about it but I haven’t been able to figure out what the correct way is.
Any ideas on how should I go about this? Thanks a lot guys.

maybe it is a builtin parameter so you need to access it by api
you an try this:

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

clr.AddReference("RevitAPI")

import Autodesk 
from Autodesk.Revit.DB import *

doc = DocumentManager.Instance.CurrentDBDocument

elem = UnwrapElement(IN[0])

TransactionManager.Instance.EnsureInTransaction(doc)

output = elem.get_Parameter(BuiltInParameter.VIEW_DETAIL_LEVEL).Set(IN[1])

TransactionManager.Instance.TransactionTaskDone()

OUT = output

Hey thanks

I find that the Python script works when selecting an existing View in the project but if it’s a newly created SectionView.ByCoordinateSystemMinPointMaxPoint in dynamo then it doesn’t seem to like it. (e.g. I have to select the SectionView id 98673 after it has been created in Dynamo)

Ah I got it, has to get the SectionView item out of the list. Silly me

1 Like