How to overwrite Detail Level of single object in view

Hi :slight_smile:
I´m trying to find a good solution to overwrite the detail level of single objects in view.

I´ve got some approches, but no proper solution:

  1. I thought about creating a new family with different detail levels, but that seems to be kind of dangerous if someone changes something in a family and does not apply changes to the copied and changed family.

  2. I thought about overwriting the visibility in model catgories. There you can change the appearance for a whole category, but not for a single object of this category.

  3. I thought about creating a Filter which would be working perfectly for this problem by adding a specific parameter to the object, but Filter does not allow to apply changes in the Detail Level

Do you have an idea how to “solve” this problem? :slight_smile:
Thanks and kind regards,
Jannis

Depending on what you’re trying to control you may be able to fake it. But (as far as I’m aware) there is no way to change the detail level of a specific element or the geometry that is visible due to detail level.

What exactly are you trying to show?

I am trying to show the wood stands of a wall (Detail Level Fine), but just for some specific walls where it is necessary to place some openings by a different person. All other walls should stay in detail level medium.

When I use Detail Level “Fine” for the whole category the PC gets ultra slow, because the wall family is quite complex.

You have even less control with system families. I don’t think there’s going to be a good way to do this.

My only suggestion right now is (if this is all for internal coordination) to filter out all the other wall types and only show the ones you need on fine. You’ll only use this view for placing openings and then you can go back to your other plans with all walls set to coarse.

2 Likes

As Nick has said, there is no way to do this. I have tried doing it myself (see below), but it doesn’t actually override the detail level.

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

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

from System.Collections.Generic import List

doc = DocumentManager.Instance.CurrentDBDocument

view = doc.ActiveView
element = UnwrapElement(IN[0])
detail_input = IN[1]
param_name = IN[2]

detail_dict = {
				'Coarse': ViewDetailLevel.Coarse,
				'Medium': ViewDetailLevel.Medium,
				'Fine': ViewDetailLevel.Fine,
				'Undefined': ViewDetailLevel.Undefined
			   }

category = element.Category.Id
# Construct .NET List of single category id
categories = List[ElementId]([category])

# Get parameter and give it a value for filtering later on
parameter = element.LookupParameter(param_name)
TransactionManager.Instance.EnsureInTransaction(doc)
parameter.Set('Override')
TransactionManager.Instance.TransactionTaskDone()

# Create FilterRule, ElementFilter, and a corresponding 
# ParameterFilterElement in the current Document
filter_rule = ParameterFilterRuleFactory.CreateEqualsRule(parameter.Id, 'Override', True)
element_filter = ElementParameterFilter(filter_rule)
TransactionManager.Instance.EnsureInTransaction(doc)
pfe = ParameterFilterElement.Create(doc, 'OverrideDetailLevel', categories, element_filter)
TransactionManager.Instance.TransactionTaskDone()

# Create overrides and set detail level to match user input
overrides = OverrideGraphicSettings()
detail_level = detail_dict[detail_input]
overrides.SetDetailLevel(detail_level)
TransactionManager.Instance.EnsureInTransaction(doc)
view.AddFilter(pfe.Id)
view.SetFilterOverrides(pfe.Id, overrides)
TransactionManager.Instance.TransactionTaskDone()

Overriding the detail level of a given view only works for model categories. If you can’t see a way to manually do something in the “Visibility/Graphic Overrides” window for a given view, it isn’t possible to do them programmatically either.

2 Likes

Thanks a lot for taking the time trying to help me :slight_smile:
Kind regards,
Jannis