My goal is to hide all of a certain type of elements in the model.
I am converting a bunch of Dynamo scripts over to Python, but I am very new to Python and the RevitAPI.
I have the following code:
els = get_elements_by_fam_name('fam_name')
t = Transaction(doc, __title__)
t.Start()
# Loop through elements
for el in els:
owner_view = doc.GetElement(el.OwnerViewId)
owner_view.HideElements(el.Id)
t.Commit() #Commit the transaction
I am doing something wrong with the HideElements() method. If I comment that line out, I can test and print all sorts of things in regards to making sure I am getting the elements, the owner views, etc. But I always get an error with the HideElements portion. I don’t know what I am missing.
Thanks for any assistance and for your patience with the new guy.