HideElementTemporary Method - Python script Error

I’m trying to use HideElementTemporary Method from Autodesk.Revit.DB.View .

But when I run it, it shows me an error .

But this method needs only one parameter .

I’m so confused.

@758347593 Try this


import clr

from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *

import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

element = UnwrapElement(IN[0])

view = UnwrapElement(IN[1])


OUT = view.HideElementTemporary(element.Id)

1 Like

The error says it all “HideElementTemporary() takes 2 arguments” right now you’re feeding only one".

1st argument = View
2nd argument = Element Id which you want to hide.

Edit: See @salvatoredragotta script it’s well explanatory.

Thanks salvatoredragotta. Now the program is running successfully. Thank you for your advice.

1 Like

Thanks for your advice, it helps a lot.

1 Like

@758347593 Please mark the topic as solved

@salvatoredragotta Thanks for reminding me.:grinning: