Archicad Python API
About automating tasks in Archicad using the Python API.

Python - Hidden / Visible elements information

davidrubio
Contributor

Hello,

 

Would there be a way to know if an element is visible or hidden when running a python script?

I'm working on a script that I would like to consider only visible elements (because I can't get their renovation status...)

 

Thanks in advance,

David

5 REPLIES 5
poco2013
Mentor

You can get the renovation status with:

 

value = acu.GetBuiltInPropertyId('Category_RenovationStatus')

 

The Python API does not have available, the visibility of elements but you can get the Layer Name of a element with 'ModelView_LayerName'

 

Then get the visibility of that Layer with: 'ModelView_IsLayerVisible'

Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27
davidrubio
Contributor

Thank you very much Gerry,

 

This is exactly what I need!

How do you find these values? It would prevent me from disturbing you! 😉

I have a "GetAllPropertyNames" list but I didn't see anything 😞

 

David

poco2013
Mentor

TRY:

 

result = acc.GetAllPropertyNames()

for x in result:

        print(x)

 

You will get a listing of all property names in the console.

The builtin properties are the 'nonlocalizedname' ones

Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27
davidrubio
Contributor

 

Thanks for your return

That's what I did but I don't have the properties you are talking about... I only have 'ModelView_LayerName'

Maybe it's because I had Archicad 24? These properties may only be available on 26...
I will try (I have all versions since 5...)

 

What does mean 'nonlocalizedname'?


Thanks a lot for your help,

 

David

The latest version of the Python API is 26.3000 available via pip install.

 

Graphisoft divides properties into two categories -- 'builtin' and 'custom'.  Custom properties are user created and are specific to a certain category of elements or 'localized'. Builtin properties may be read only or read/write and are generally applicable to all elements or exist for a specific purpose. They are universal or 'nonlocalized'

Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27