cancel
Showing results for 
Search instead for 
Did you mean: 
EN
cancel
Showing results for 
Search instead for 
Did you mean: 
_carlos
Contributor

Feature request: default/custom status of property values without evaluating expressions

What we need
For an expression-based property, the list of elements whose value is a custom (overridden) value. The expression should not have to be evaluated on the elements that use the default.

Why
We export large models (IFC / Fragments) from an add-on, through the JSON automation of the Tapir add-on. Reading expression-based property values element by element is the slowest part of the export, so our script computes the expressions itself and only asks Archicad when needed. Custom values are the weak point: if someone overrides an expression property by hand on some elements, we need to know which elements, so that we read only those from Archicad.

What the API offers today
As far as I can see in the Archicad 30 DevKit (30.3000), the status is only available as `API_Property::isDefault`. That field is filled by `ACAPI_Element_GetPropertyValue(s)` / `ACAPI_Element_GetPropertyValuesByGuid`, and `APIdefs_Properties.h` says the value field always contains the evaluated value. So reading the status costs as much as reading the value.

What Archicad already does
In Find & Select, on a hospital project (Archicad 29, about 7,500 elements), *has default value* on an expression-based property returns quickly, with a few hundred matches. *is \<value\>* on the same property is slow. So Archicad can tell default from custom without evaluating the expression. It just isn't exposed to add-ons.

Request
Any of these would solve it, ideally as a batch call for many elements:
1. A function that returns only the default/custom status (no value) for given elements and property definitions.
2. An option on `ACAPI_Element_GetPropertyValues*` to skip evaluating default values and return only the status.
3. A query that returns the elements with a custom value for a given property definition, like the Find & Select criterion.

The same in the JSON API (e.g. `isDefault` in `GetPropertyValuesOfElements`) would help scripts that don't run as add-ons.

Related discussion in Tapir: https://github.com/ENZYME-APD/tapir-archicad-automation/pull/1292

 

Operating system used: Windows 11 24H2

0 Replies 0

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!

Video Thumbnail