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

ChangeDefaultsHandler function example clearification needed

A101
Participant

Hi, in this (ChangeDefaultsHandler) example here: 

 

https://archicadapi.graphisoft.com/documentation/acapi_notify_catchchangedefaults

 

what is (GetElementTypeString) refrencing to? does this function exist anymore? 

 

1 REPLY 1

Hi,

From the name and signature it seems to give a string corresponding to the element type. So e.g. Giving it "API_DoorID" would return a string similar to: "Door".

Indeed you can find an implementation in the "Notification_Manager" example in the SDK.
Here is the code from the AC26 SDK:

 

bool GetElementTypeString (const API_ElemType& type, char *elemStr)
{
  GS::UniString ustr;
  GSErrCode err = ACAPI_Goodies_GetElemTypeName (type, ustr);
  if (err == NoError) {
    CHTruncate (ustr.ToCStr (), elemStr, ELEMSTR_LEN - 1);
    return true;
  }
  return false;
}

 

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!