cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

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!

Return the language of the running archicad

Emkave
Contributor

Good day everyone!
I have a problem with returning the language value of running Archicad.
I want to do something related to localization and stuff but for that I want to know firstly what language is used by the user.

Do you know any way of returning the language of an active Archicad session? I guess the methods may differ for pre 27, 27 and beyond versions, right?

 

Thanks in advance!

 

Operating system used: Windows 10

2 ACCEPTED SOLUTIONS

Accepted Solutions
Solution
kuvbur
Enthusiast

Try ACAPI_AddOnIdentification_Application()

 

 

API_ServerApplicationInfo AppInfo;
GS::UniString language = "";
err = ACAPI_AddOnIdentification_Application (&AppInfo);
if (err == NoError){
    language = AppInfo.language;
}

 

 

 
 

 

 

Structural engineer, developer of free addon for sync GDL param and properties

View solution in original post

Solution
kuvbur
Enthusiast

List of value

In AC26 and older:

 

 

 

API_ServerApplicationInfo AppInfo;
GS::UniString language = "";
err = ACAPI_Environment (APIEnv_ApplicationID, &AppInfo);
if (err == NoError){
    language = AppInfo.language;
}

 

 

 

Structural engineer, developer of free addon for sync GDL param and properties

View solution in original post

4 REPLIES 4
Solution
kuvbur
Enthusiast

Try ACAPI_AddOnIdentification_Application()

 

 

API_ServerApplicationInfo AppInfo;
GS::UniString language = "";
err = ACAPI_AddOnIdentification_Application (&AppInfo);
if (err == NoError){
    language = AppInfo.language;
}

 

 

 
 

 

 

Structural engineer, developer of free addon for sync GDL param and properties

Hi, thank you for the solution.
However, the issue is - when I tried this on my device, it returned me INT value (international -> English, I assume).
I wonder what is the list of language tags existing there in archicad. Do you know where I can find that list?

Also, do you know how would that be written for versions older than 27? Like for 26?

Solution
kuvbur
Enthusiast

List of value

In AC26 and older:

 

 

 

API_ServerApplicationInfo AppInfo;
GS::UniString language = "";
err = ACAPI_Environment (APIEnv_ApplicationID, &AppInfo);
if (err == NoError){
    language = AppInfo.language;
}

 

 

 

Structural engineer, developer of free addon for sync GDL param and properties

Setup info provided by author