2025-03-28 11:02 AM
I try to upgrade my addon AC26 to AC28.
I can't find 'ACAPI_Element_GetIFCType' and 'ACAPI_IFC_APIGuidToIFCGuid'.
When I change objects's parameter, I was change material index with short.
But in AC28, index change to API_AttributeIndex.
How to change API_Attribute to short? ToInt32_Deprecated is this right?
2025-04-07 04:15 AM
Hi, I'd suggest you to check the API Example code (IFC_Test/IFCAPI_Test.cpp), which using GetIFCType().
Yes, you can use ToInt32_Deprecated() to have short value.
HTH.
2025-04-09
06:55 AM
- last edited on
2025-05-23
11:57 PM
by
Laszlo Nagy
Thank you for your help.
I find the way to get IFC type and global ID.
But it throws an access violation error. (0xC0000005: 0xFFFFFFFFFFFFFFFF )
It looks like it's an error that occurs when freeing externalGlobalId.
for (int i = 0; i < selList.GetSize(); i++)
{
UniString ifcType = L"", ifcIdStr = L"";
API_Elem_Head elemHead;
elemHead.guid = selList[i].GetGuid();
ACAPI_Element_GetHeader(&elemHead);
auto objectID = IFCAPI::GetObjectAccessor().CreateElementObjectID(elemHead);
auto ifcTypeResult = IFCAPI::GetObjectAccessor().GetIFCType(objectID.Unwrap());
if (ifcTypeResult.IsOk())
ifcType = ifcTypeResult.Unwrap();
auto externalGlobalId(IFCAPI::GetObjectAccessor().GetExternalGlobalId(objectID.Unwrap()));
if (externalGlobalId.IsOk())
{
ifcIdStr = externalGlobalId.Unwrap();
}
else
{
auto globalId = IFCAPI::GetObjectAccessor().GetGlobalId(objectID.Unwrap());
if (globalId.IsOk())
ifcIdStr = globalId.Unwrap();
}
}
2025-05-23 08:44 AM
This should be basically the same issue as in: https://community.graphisoft.com/t5/Archicad-C-API/I-have-a-problem-when-I-release-ExternalGlobalId/...
Please do try to work with Release builds until we can find out what causes this in Debug.
Unfortunately we dont see the actual problem at the moment, but it is very general and not specific to IFC related API.