Temporary hide in Dynamo

Hi there!

I’ve found a node about isolate elements in view (Archi-lab_Grimshaw Package) and I’m wondering if there’s a node which alow me to temporary hide an element in view.

Thks

Manel

Yes. In that same package.

Sorry, I don’t find it in archilab package.

I’ve modified Isolate in view node to get what I want.

Cheers

Manel

Manel_Fernandez
Any chance of you sharing that node with us?

Hi there,

You could use this node form Clockwork package:

imagen

Cheers

Tried that, but I need to temporarily hide elements not isolate them.

Hence my asking

Hi there,

You can use the same node, just edit the python node inside this node to:

import clr
clr.AddReference(‘RevitAPI’)
from Autodesk.Revit.DB import *
from System.Collections.Generic import *

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

doc = DocumentManager.Instance.CurrentDBDocument
elements = UnwrapElement(IN[0])
view = UnwrapElement(IN[1])
ids = list()
booleans =
for item in elements:
ids.append(item.Id)
ielements = ListElementId

TransactionManager.Instance.EnsureInTransaction(doc)
try:
view.HideElementsTemporary(ielements)
booleans.append(True)
except: booleans.append(False)
TransactionManager.Instance.TransactionTaskDone()
OUT = (view,elements,booleans)

The diference is:
File22:
Original:
view.IsolateElementsTemporary(ielements)
Modification:
view.HideElementsTemporary(ielements)

Cheers

Cheers… appreciate you sharing.

What’s the symbol after booleans = ?

I can’t seem to copy it, after pasting it is blank.

You can edit View Temporarily Isolate Element from Clockwork pakage:
imagen
import clr
clr.AddReference(‘RevitAPI’)
from Autodesk.Revit.DB import *
from System.Collections.Generic import *

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

def TempHideElements(view, items):
if not items: return False
elif not isinstance(items, list): items = [items]
ielements = List[ElementId]([x.Id for x in UnwrapElement(items)])
try:
UnwrapElement(view).HideElementsTemporary(ielements)
return True
except: return False

doc = DocumentManager.Instance.CurrentDBDocument

TransactionManager.Instance.EnsureInTransaction(doc)
if isinstance(IN[1], list):
if isinstance(IN[0], list): OUT = [TempHideElements(x, y) for x, y in zip(IN[1], IN[0])]
else: OUT = [TempHideElements(x, IN[0]) for x in IN[1]]
else: OUT = TempHideElements(IN[1], IN[0])
TransactionManager.Instance.TransactionTaskDone()

its booleans = [] but shows up as because the person did not format it as code using the </> button.

Untitled6

Thank you for this, however I’ve arrived with an warning message. What could be the cause? Thanks

I get the same warning, when its feed with inputs… what could be wrong?