cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
2024 Technology Preview Program

2024 Technology Preview Program:
Master powerful new features and shape the latest BIM-enabled innovations

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

AC28: Builtin Properties no longer available -> Worse Compatibility with AC Language Versions

Hi all,

 

I’m aware that Built-In Properties are no longer accessible through the Archicad SDK.
Unfortunately, this means that making an Add-On compatible with all language version is now drastically more difficult!
Previously for example the property “ElementID” was available in the Property Group “GeneralElemProperties” and to my knowledge this was the same across all Archicad language versions. If we want to change or access this property now, we have to know it’s name and group name for all languages. I wasn't able to find a list for such translations yet. I'm afraid I'll have to download all Language versions and produce the list myself.

Does anybody already have such a list of translations for properties like Element ID?

 

If there's no easy workaround, please @Akos Somorjai  consider reintroducing a way to access such properties independent of the AC language version! 

Best,
Bernd

Bernd Schwarzenbacher - Archicad Add-On Developer - Get Add-Ons & Archicad Tips on my Website: Archi-XT.com
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Viktor Kovacs
Graphisoft
Graphisoft

Hi Bernd,

 

The future-proof way of identifying built-in properties is to use their guids. You can hard-code the guid in your code, just as you hard-coded the name earlier. To get the list of available built-in properties with their guids you can use this code:

 

void DumpAllBuiltInProperties ()
{
    GS::Array<API_PropertyGroup> groups;
    ACAPI_Property_GetPropertyGroups (groups);
    for (const API_PropertyGroup& group : groups) {
        GS::Array<API_PropertyDefinition> definitions;
        ACAPI_Property_GetPropertyDefinitions (group.guid, definitions);
        for (const API_PropertyDefinition& definition : definitions) {
            if (definition.definitionType != API_PropertyStaticBuiltInDefinitionType) {
                continue;
            }
            GS::UniString report =
                group.name + "\t" +
                definition.name + "\t" +
                APIGuidToString (definition.guid);
            ACAPI_WriteReport (report, false);
        }
    }
}

 

 

View solution in original post

5 REPLIES 5
Solution
Viktor Kovacs
Graphisoft
Graphisoft

Hi Bernd,

 

The future-proof way of identifying built-in properties is to use their guids. You can hard-code the guid in your code, just as you hard-coded the name earlier. To get the list of available built-in properties with their guids you can use this code:

 

void DumpAllBuiltInProperties ()
{
    GS::Array<API_PropertyGroup> groups;
    ACAPI_Property_GetPropertyGroups (groups);
    for (const API_PropertyGroup& group : groups) {
        GS::Array<API_PropertyDefinition> definitions;
        ACAPI_Property_GetPropertyDefinitions (group.guid, definitions);
        for (const API_PropertyDefinition& definition : definitions) {
            if (definition.definitionType != API_PropertyStaticBuiltInDefinitionType) {
                continue;
            }
            GS::UniString report =
                group.name + "\t" +
                definition.name + "\t" +
                APIGuidToString (definition.guid);
            ACAPI_WriteReport (report, false);
        }
    }
}

 

 

Thanks Viktor!

That does indeed work across languages (tested with AC28 INT/GER/ITA - Tech Preview).
I had the wrong assumption, that different property names would automatically lead to different GUIDs and that's why I've relied on the Fundamental BuiltIn property in the past. Might be that built-in properties are special regarding that. Thanks a lot for clearing it up 🙂

For reference: The 'Element ID' Property has the following GUID: 7E221F33-829B-4FBC-A670-E74DABCE6289

Bernd Schwarzenbacher - Archicad Add-On Developer - Get Add-Ons & Archicad Tips on my Website: Archi-XT.com
Botonis
Advisor

I totally support Bernd on this. Addon developers are a significant part of Archicad 's evolment and users' workflow.

Their work should be more productive and creative and so the SDK must also aim on this.

 

Edit: Glad that the instant solution by @Viktor Kovacs cleared things up. 

Botonis Botonakis
Civil Engineer, Enviromental Design MSc., BIM Manager for BS ArhitectsVR
Company or personal website
Archicad 27. Windows 11. Intel Xeon 2699x2,64 GB RAM, Nvidia 3080Ti. 2 Monitors.
Viktor Kovacs
Graphisoft
Graphisoft

Yes, built-in property guids are stable across Archicad versions and languages. 🙂

Thanks @Botonis for always having my back!
Fortunately, the way Viktor showed is a very easy and better alternative to do the thing I tried to do 😀

Bernd Schwarzenbacher - Archicad Add-On Developer - Get Add-Ons & Archicad Tips on my Website: Archi-XT.com