We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

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

Restore "Link to Default" property values by Python

_c_
Enthusiast

I am trying to set elements' values to their defaults: be it undefined, expression, or value. Whatever is in the Attribute Manager for the property definition. For clarifying, by default will look like this upon selection:

default undefined value default defined value default expression
def undefined.png def value.png def expr.png

 

There is no direct access in the JSON API, but I found a trick to determine if a property is defined by expression: they DON'T have a "defaultValue" dict key.

 

It seems nevertheless to be impossible to actually SET the property value to "Link to Default". Whenever I copy the defaults from the property definition into the element's value this turns into "custom".

 

Does anyone know a trick?

 

_c_
1 REPLY 1
_c_
Enthusiast

I'd like to put this thread into the praxis context it came from.

I was working on a door list with odd 1800 items when I realised that a large number of elements had an override of "from/to room number" calculated properties into a fixed custom value. It came from ill prepared favourites.

This could have been a fatal error.

 

It is important to fish out elements whose calculations are overridden and possibly set them by script.

_c_