I have a problem when I release 'ExternalGlobalId'
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
2 weeks ago
I have some problem to get 'ExternalGlobalId' and 'GlobalId' in ArchiCAD28.
I want to get 'ExternalGlobalId', if there 'ExternalGlobalId' is exist.
And, if 'ExternalGlobalId' is not exist, I want to get 'GlobalId'.
An error occurs when exiting the for loop.
Occurs only when 'ExternalGlobalId' is not present.
In 'Microsoft Visual Studio\2019\Professional\VC\ToolsMSVC\14.29.30133\include\xmemory'.
0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF
This is my code.
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();
}
}
0 REPLIES 0