Python IsHidden() function

Hello,

I guess for some of you this is an idiot question, but i can’t figure out wat i am doing wrong here. I want to run a script that hides grids from linked models in the active view.

image
image

I think i am getting close but i get the following error.

Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “”, line 42, in
TypeError: expected View, got List[Element]

To my understanding the active view i filtered out is a view and not a list?
Could somebody clarify this for me please?

Thanks alot for the help

regards

“view” is a list since you are running it in a for loop.
So line 42 should refer to the item in that loop. In your case: “links”

Change
if not i.IsHidden(view) and i.CanBehidden(view):

into
if not i.IsHidden(links) and i.CanBehidden(links):

Ok i now understand what i did wrong there but now it says
Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed. _
Traceback (most recent call last):
_ File “”, line 43, in

TypeError: expected View, got ElevationMarker

I also noticed i made some errors with the filteredelementcollectors , but still the error.
code looks like this now.

It’s not possible via API

Bummer , thanks for the response!

@gerben.luyckx4CLZC , you can Hide/Unhide link documents levels and grids with ElementGraphics.LinkLevelGrid node from Quasar Package.

I attached the script, in case you might want to explore …
link-level-grid.dyn (5.3 KB)

1 Like

Quasar node hangs revit on bigger project.

Thanks @jean very useful.
However i work for a big company and all the different packages makes it hard to share the Dynamo scripts with alot of other users. I lost count of how many i already used.
Thats why i want to do code it myself with Python.

Don’t know why @Tomasz_Puchala says it is not possible when there is a node?

Hi,

The Quasar node creates a view filter. It’s smart, but you can do it manually in a few clicks.
@Tomasz_Puchala is right, what you’re trying to do isn’t currently possible with the API.

Ah that is a good solution. I will look for a solution the same way then.
Guess this is solved then!