We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2021-08-20 01:09 PM - last edited on 2021-09-14 09:20 AM by Noemi Balogh
2021-08-20 02:57 PM
for (UIndex i = 0; i < array.GetSize (); i++) { const API_Guid& guid = array; // do something with the guid }or
for (const API_Guid& guid : array) { // do something with the guid }
2021-08-20 02:58 PM
GS::Array<API_Guid> array; for(auto element : elemList) {...}or
for (GS::Array<API_Guid>::ConstIterator element = array.Enumerate(); element != nullptr; ++element ) {...}
2021-08-20 03:30 PM
for (const API_Guid& guid : arrayOfGuids) { ACAPI_WriteReport("%s", false, guid); }It is not printing anything. How to print an API_Guid ?
2021-08-21 12:18 AM
char hold[254] = {}; APIGuid2GSGuid(guid).ConvertToString(hold) ACAPI_WriteReport("%s",false,hold);
2021-08-21 11:04 AM
poco2013 wrote:Thanks Gerry, that worked perfectly.
This will work but is not the optimum way. Someone else may input the proper utility but this is what I use.
Code: Select all
char hold[254] = {};
APIGuid2GSGuid(guid).ConvertToString(hold)
ACAPI_WriteReport("%s",false,hold);
2021-08-21 11:27 AM
dushyant wrote:They are essentially the same thing except GS::Guid is packed as a Class and API_Guid is a structure.
So API-Guid and GS-Guid are different?
"API_Guid is essentially a GS::Guid. It has the same size and structure, and only exists because of certain C++ language limitations: namely that a union (like API_Element) cannot contain a class which has a constructor or destructor. Since API_Elem_Head needs to contain a Guid member, and it cannot be a GS::Guid, the API_Guid structure was introduced."
2021-08-23 08:15 AM
poco2013 wrote:Thanks a lot Gerry!
They are essentially the same thing except GS::Guid is packed as a Class and API_Guid is a structure.
From the API Manual:
"API_Guid is essentially a GS::Guid. It has the same size and structure, and only exists because of certain C++ language limitations: namely that a union (like API_Element) cannot contain a class which has a constructor or destructor. Since API_Elem_Head needs to contain a Guid member, and it cannot be a GS::Guid, the API_Guid structure was introduced."