We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2017-01-04 02:16 PM - last edited on 2023-07-12 08:56 PM by Doreena Deng
2017-01-05 05:40 PM
void ClickedDoorInfo (void) { API_Element element; API_DoorRelation doorInfo; BNZeroMemory (&element, sizeof (API_Element)); if (!ClickAnElem ("Click a door", API_DoorID, nullptr, &element.header.typeID, &element.header.guid)) { WriteReport_Alert ("No door was clicked"); return; } GSErrCode err = ACAPI_Element_Get (&element); if (err != NoError) { ErrorBeep ("ACAPI_Element_Get (door)", err); return; } err = ACAPI_Element_GetRelations (element.header.guid, API_ZombieElemID, &doorInfo); if (err != NoError) { ErrorBeep ("ACAPI_Element_GetRelations (door, all data)", err); return; } API_Element wallElement, fromRoomElement, toRoomElement; // Get the information about the owner wall ----------------------- WriteReport ("Owner wall: %s", APIGuidToString (element.door.owner).ToCStr ().Get ()); wallElement.header.guid = element.door.owner; if (ACAPI_Element_Get (&wallElement) == NoError) { WriteReport (" wall composite: %d", wallElement.wall.composite); WriteReport (" wall thickness at the beginning: %f", wallElement.wall.thickness); WriteReport (" wall thickness at the end: %f", wallElement.wall.thickness1); } // Get the information about the rooms ----------------------- WriteReport ("Connected rooms:"); WriteReport (" fromRoom: %s", APIGuidToString (doorInfo.fromRoom).ToCStr ().Get ()); WriteReport (" toRoom : %s", APIGuidToString (doorInfo.toRoom).ToCStr ().Get ()); fromRoomElement.header.guid = doorInfo.fromRoom; toRoomElement.header.guid = doorInfo.toRoom; if (ACAPI_Element_Get (&fromRoomElement) == NoError) { WriteReport (" fromRoom name: %s", GS::UniString (fromRoomElement.zone.roomName).ToCStr ().Get ()); WriteReport (" fromRoom number: %s", GS::UniString (fromRoomElement.zone.roomNoStr ).ToCStr ().Get ()); } if (ACAPI_Element_Get (&toRoomElement) == NoError) { WriteReport (" toRoom name: %s", GS::UniString (toRoomElement.zone.roomName).ToCStr ().Get ()); WriteReport (" toRoom number: %s", GS::UniString (toRoomElement.zone.roomNoStr ).ToCStr ().Get ()); } // Get the value of the ac_openingSide parameter ----------------------- API_ElementMemo memo; if (ACAPI_Element_GetMemo (element.header.guid, &memo) == NoError) { API_AddParType **params = memo.params; Int32 n = BMGetHandleSize ((GSHandle) params) / sizeof (API_AddParType); for (int i = 0; i < n; i++) { if (CHEqualASCII ((*params).name, "ac_openingSide", CS_CaseInsensitive)) { WriteReport ("ac_openingSide: %s", (*params).value.uStr); break; } } ACAPI_DisposeElemMemoHdls (&memo); } return; }Regards,
2017-01-09 10:45 AM
2017-01-13 05:32 PM
2017-12-12 10:25 AM
Regina wrote:The infos I am trying to get are in the picture (Doorstamp->Settings->Content3->...):
Hi,
The name of the parameter which describes the hinge side is "ac_openingSide".
Regards,
Regina
2018-01-05 02:01 PM
mar_kq wrote:Hi,
Hello Regina:
I was hoping to get some clues as to the best approach for getting Door Label/Stamp Attributes with the API.
You had provided very useful information before:
Regina wrote:The infos I am trying to get are in the picture (Doorstamp->Settings->Content3->...):
Hi,
The name of the parameter which describes the hinge side is "ac_openingSide".
Regards,
Regina
https://drive.google.com/file/d/1CJJ4gqQRDYQHdMMkrW-O3u-rf41lVMNz/view
It is not clear to me wether these informations should be within the door object/libpart or in the stamp/label itself.
My guess is that they are actually stored in the stamp/label settings. I do not know however how to get a handle to this from the door.
Any suggestions would be appreciated.
GS::Array<API_Guid> connectedLabels; ACAPI_Element_GetConnectedElements (doorGuid, API_LabelID, &connectedLabels);
2018-01-11 11:13 AM
Akos wrote:Hi Akos,
Hi,
The following code snippet will give you the label(s) connected to a door/window:
GS::Array<API_Guid> connectedLabels; ACAPI_Element_GetConnectedElements (doorGuid, API_LabelID, &connectedLabels);
Best, Akos