2023-12-21 12:19 AM - last edited on 2024-09-16 02:41 PM by Doreena Deng
Hello fellow developers,
I'm currently working on an Archicad Add-On where I need to extract detailed information about dimension elements. My current implementation allows me to retrieve basic information such as the GUID, line pen, and text position of dimension elements. Here is a snippet of my code for context:
void ReportDimensionElementProperties(const API_Guid& elementGuid, API_ElemTypeID elemType, std::ofstream& outFile) {
char reportStr[1024];
API_Element element;
BNZeroMemory(&element, sizeof(API_Element));
element.header.guid = elementGuid;
GSErrCode err = ACAPI_Element_Get(&element);
if (err == NoError && elemType == API_DimensionID) {
API_DimensionType& dimension = element.dimension;
// Format the report string with extracted properties from linear dimension
sprintf(reportStr, "Linear Dimension, GUID: %s, Line Pen: %d, Text Position: %d",
APIGuidToString(elementGuid).ToCStr().Get(),
dimension.linPen,
dimension.textPos);
outFile << reportStr << std::endl;
}
else {
// Handle error in retrieving the element or unsupported element type
}
}
However, I would like to delve deeper and retrieve more information such as:
I've explored the Archicad API documentation but haven't found a clear path to achieve this. Does anyone have experience or suggestions on how to extract these additional details for dimension elements? Any insights or guidance would be greatly appreciated, especially code snippets or references to specific API functions that could be useful.
Thank you in advance!