Family Editor: "Family Element Visibility Settings" for Plan/RCP

Does anyone know if there’s a node or package that can manipulate the on/off values in the Family Element Visibility Settings of Revit’s family editor?

My goal is to create a graph that will open all Specialty Equipment families and toggle “on” the Plan/RCP visibility for all geometry in the family and re-load them into the model.

Here’s an image of the dialog box inside the family editor that I am referring to:

Family%20Element%20Visibility%20Settings

Thank you

Any luck with this stuff?
I think I found the class we’ll need to use in the RevitAPI docs here:
http://www.revitapidocs.com/2020/7c6e06c8-7252-79dc-729c-945c9bf2faae.htm

I’m having trouble using it correctly in dynamo/python though…

was searching on this topic today,
no experiences right now?

Funny i had to do something like that not too long ago


# Charger les bibliothèques DesignScript et Standard Python
import sys
import clr,System
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)

doc = DocumentManager.Instance.CurrentDBDocument

def toList(elt):
	if isinstance(elt,list):
		return UnwrapElement(elt)
	else:
		return [UnwrapElement(elt)]
		
elt = UnwrapElement(IN[0])
coarse = IN[1]
medium = IN[2]
fine = IN[3]
frontBack = IN[4]
leftRight = IN[5]
planRCPCut = IN[6]

visibility = FamilyElementVisibility(FamilyElementVisibilityType.Model)
visibility.IsShownInCoarse = coarse
visibility.IsShownInMedium = medium
visibility.IsShownInFine = fine
visibility.IsShownInFrontBack = frontBack
visibility.IsShownInLeftRight = leftRight
visibility.IsShownInPlanRCPCut = planRCPCut
TransactionManager.Instance.EnsureInTransaction(doc)
elt.SetVisibility(visibility)
TransactionManager.Instance.TransactionTaskDone()

OUT = "ok"
1 Like

Wow,
nice thanks for sharing.

I found that with the OOTB-Nodes it is also possible to change the setting, but only running in Family Editor.

What is the input? is it “Selected Element”?
or is it possible to select a family in Project and change the behavior of that family with Dynamo Player then?

BR
Heinrich Boldt

Since your changing something inside a family you need to access the geometry in the family so no you cannot do that from a project.
The input is the element you want to change. It was to change some lines in ly case so i would filter the lines based on the type and change the values.

1 Like

Visibility Settings Familyeditor.dyn (31.5 KB)
this is what I used to change the Visibility.
We use lots of Subcategories for Lines and 3D Elements.
I filtered all 3D-Elements and changed the visibility for “planRCPCut” to true.
I would like to use it in the project with View templates - when the visibility is disabled, we cant use it in View templates :slight_smile:

I tried your script, but I got an error :frowning:

Thanks again for participating in this discussion
Heinrich Boldt

Symbolic lines and model elements do not use the same code actually

@Daniel_Hurtubise I too tried using your Python script to control the visibility of objects in my Family. It works great for objects like extrusions, but whenever I try to use it on Model Lines, I receive an error stating that the object doesn’t have a “SetVisibility” attribute. I know I can manually adjust the visibility on the Model Lines. But I am confused as to why it doesn’t work with the Python Script that you provided. Any insight would be greatly appreciated.