BIM Coordinator Program (INT) April 22, 2024

Find the next step in your career as a Graphisoft Certified BIM Coordinator!

Archicad C++ API
About Archicad add-on development using the C++ API.
SOLVED!

How to change a properties type to custom-defined?

Dayiz
Booster

Hello dear Community,

 

I want to change a property with an AddOn but for some reason my values always turn out undefined.

The property starts with its default value:

1.png

Sorry for the german bits, let met translate the important part:

Standard (Nicht definiert) = Standard (not definied)

Individuell (Wert) = Custom (value)

Als nicht definiert festgelegt = Set as not defined // Custom (not defined)

 

Now when i run the AddOn, the property gets set to "Custom (not defined)"

2.png

and the value is <Nicht definiert> (not defined).

 

Now when i set the property to Individuellen Wert festlegen (Set custom value) and put in anything (like "123")

3.png

and then run my AddOn, the property gets set the way i want to.

4.png

But i can't find out how i can change the property to "Custom (value)", so that my property gets set by the AddOn, currently i only get <not defined>.

 

Here the important parts of my code:

5.png

I left out the functions "getSelectedElements" and "findPropertyDefinition" because they work and should have no impact on the <not defined> part.

 

Thanks for any help in advance 🙂

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

Thanks for your help Misa_M.

I figured it was a problem like that and tried to find the property setting in the API doc, but couldnt find it.

 

What worked was to create a new property instead of copying and editing the old property

5.png

Seems like the old property had the <not defined> part baked in or something like that.

View solution in original post

2 REPLIES 2
Miha_M
Advisor

I am nowhere near being C++ enabled, but on Archicad side I suspect the problem may be somewhere on an elevated level. Each property, which is not set, has the <not defined> default value status. You'll need to find a path to switch this status from "Undefined" to "Value" first. But I have no clue as to how this can be triggered. A screenshot of Property Manager for better explanation of the mentioned "elevated" level:

 

Miha_M_0-1661944400917.png

But in the first two of your screenshots it seems like you have managed to switch this status (API_PropertyCustomDefinitionType?), only the value remains in a <not defined> state.

| Archicad 4.55 - 27
| HP Z840 | 2× E5-2643 v4 | 64 GB RAM | Quadro M5000 | Windows 10 Pro x64
| HP Z4 G4 | W-2245 | 64 GB RAM | RTX A4000 | Windows 11

Solution

Thanks for your help Misa_M.

I figured it was a problem like that and tried to find the property setting in the API doc, but couldnt find it.

 

What worked was to create a new property instead of copying and editing the old property

5.png

Seems like the old property had the <not defined> part baked in or something like that.

Learn and get certified!