We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2020-02-04 10:48 AM - last edited on 2022-10-04 04:23 PM by Daniel Kassai
2020-02-04 02:28 PM
dushyant wrote:Classifications and Properties have to be set separately. Use
Any idea why the Classification is not getting set to that of the Favorite? (It's not changing at all)
2020-02-05 01:37 PM
API_Element& favElement = favorite.element; API_ElementMemo& favMemo = favorite.memo.Get(); API_ElemTypeID typeID = tboxInfo.typeID; API_ElemVariationID variationID = APIVarId_LabelWall2; GS::Array<GS::Pair<API_Guid, API_Guid>> systemItemPairs; ACAPI_Element_GetClassificationItemsDefault(typeID, variationID, systemItemPairs);I am not able to figure out how to print/output the contents of
2020-02-05 01:48 PM
for (auto i = systemItemPairs.Begin(); i != systemItemPairs.End(); ++i) { //guid of system is i->first //guid of item is i->second }
2020-02-05 02:15 PM
2020-02-05 02:41 PM
dushyant wrote:Use
Is there a way to translate these guids into names?
2020-02-05 04:21 PM
2020-02-05 06:16 PM
GS::Array<GS::Pair<API_Guid, API_Guid>> systemItemPairs; ACAPI_Element_GetClassificationItemsDefault(typeID, variationID, systemItemPairs); for (auto i = systemItemPairs.Begin(); i != systemItemPairs.End(); ++i) { system.guid = i->first; item.guid = i->second; ACAPI_WriteReport("\nsystem guid: %d\n item guid: %d\n", false, system.guid, item.guid); }Not able to get the guid of a favorite like this:
API_Favorite favorite (favName); API_Element& favElement = favorite.element; ACAPI_WriteReport("favElement.header.guid: %d", false, favElement.header.guid);Tried to get the systemItemPair of the favorite like this:
ACAPI_Element_GetClassificationItems(favElement.header.guid, favorite.classifications.Get());and fed it into the for-loop like for default, it gave out a huge list of pairs instead of just one for the favorite in question.
ACAPI_Element_RemoveClassificationItemDefault(typeID, variationID, item.guid);But the default Classification is not getting set by:
ACAPI_Element_AddClassificationItemDefault(typeID, variationID, favElement.header.guid);Please help!
2020-02-07 11:07 AM
dushyant wrote:That's the default constructor for
Not able to get the guid of a favorite like this:API_Favorite favorite (favName);
2020-02-07 11:14 AM
2020-02-07 11:38 AM
dushyant wrote:The function
ACAPI_Element_GetClassificationItems(favElement.header.guid, favorite.classifications.Get()); // this is not working