APIAny_​GetAutoTextsID

Retrieves the key, description and value of the currently available autotexts.

    GSErrCode ACAPI_Goodies (
        APIAny_GetAutoTextsID,
        Uni3Array*            autotexts,
        API_AutotextType      autotextType
    );

    typedef GS::Array< GS::ArrayFB<GS::UniString, 3> > Uni3Array;

Parameters

autotexts
[out] Array of UniString triplets containing description, key and value of an autotext
autotextType
[in] Filter for collecting only the given type of autotexts

 

Return Values

NoError
The function has completed with success.
APIERR_BADPARS
The passed autotexts parameter is nullptr.

For other common API errors see the API Errors document.

 

Remarks

21 This function and APIAny_GetAutoTextKeysID can only resolve non-context dependent autotexts like “PROJECTNAME”, “PROJECTNUMBER”, “COMPANY”, “SHORTDATE”. For context dependent autotexts please use APIAny_GetPropertyAutoTextKeyTableID with APIAny_InterpretAutoTextID

Use this function to get the key, the description (as it is referenced in the user interface of ARCHICAD), and the current value of the autotexts. The autotext data is retrieved in an array of array of UniStrings, so you do not need to free the allocated memory, as it is disposed automatically in the destructor.

The UniString triplets contain the autotext data in the following order: description text, database key, value.

You can control the range of the autotexts to be retrieved with the API_AutotextType parameter.

You can modify the value of an autotext with APIAny_SetAnAutoTextID.

 

Example


#include "UniString.hpp"
#include "Array.hpp"

GS::Array<GS::ArrayFB<GS::UniString, 3> > autotexts;
API_AutotextType type = APIAutoText_Fixed;

GSErrCode err = ACAPI_Goodies (APIAny_GetAutoTextsID, &autotexts, (void *) (Int32) type);
if (err == NoError) {
    for (ULong i = 0; i < autotexts.GetSize (); i++) {
        DBPrintf ("AutoText[%03d] \"%s\" (\"%s\") = \"%s\"\n", i,
            (const char *) autotexts[i][0].ToCStr (), (const char *) autotexts[i][1].ToCStr (), (const char *) autotexts[i][2].ToCStr ());
    }
}

 

Requirements

Version: API 10 or later
Header: APIdefs_Goodies.h

 

See Also

APIAny_GetPropertyAutoTextKeyTableID
APIAny_InterpretAutoTextID
API_AutotextType
APIAny_GetAutoTextKeysID
APIAny_SetAnAutoTextID
ACAPI_Goodies
API Functions