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.
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
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
element = UnwrapElement(IN[0])
view = UnwrapElement(IN[1])
TransactionManager.Instance.EnsureInTransaction(doc)
OUT = view.HideElementTemporary(element.Id)
TransactionManager.Instance.TransactionTaskDone()
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.
Thanks for your advice, it helps a lot.