IFCAPI::GetObjectAccessor's problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago - last edited a week ago
I previously left an inquiry regarding ExternalGlobalId.
Problem 1
I tried to use it without ExternalGlobalId but still have the same problem.
If IFCAPI::GetObjectAccessor().GetIFCType(objectID.Unwrap())'s or or IFCAPI::GetObjectAccessor().GetGlobalId(objectID.Unwrap())'s ok_ is false, I got an access error.
The error occur in 'ACAPI::Result<GS::UniString, ACAPI::Error>::~Result<GS::UniString, ACAPI::Error>()' and 'ACAPI::details::Storage<GS::UniString, ACAPI::Error>::destroy(ACAPI::details:;err_tag__formal)'.
This is the same as ExternalGlobalId.
I tried to solve it using try-catch but it doesn't work.
void GetIFCTypeID(API_Guid elemGuid, GS::UniString& ifcType, GS::UniString& ifcIdStr)
{
API_Elem_Head elemHead;
elemHead.guid = elemGuid;
ACAPI_Element_GetHeader(&elemHead);
auto objectID = IFCAPI::GetObjectAccessor().CreateElementObjectID(elemHead);
if (objectID.IsOk())
{
auto ifcTypeResult = IFCAPI::GetObjectAccessor().GetIFCType(objectID.Unwrap());
if (ifcTypeResult.IsOk())
{
ifcType = ifcTypeResult.Unwrap();
auto globalId(IFCAPI::GetObjectAccessor().GetGlobalId(objectID.Unwrap()));
if (globalId.IsOk())
ifcIdStr = globalId.Unwrap();
}
}
}
Problem 2
The object has an IFC Type and a Global ID, but GetIFCType and GetGlobalId return false.
This is parameters.
And this is elements's property in archicad.
Unique ID is same with elemGuid.
In archicad IFC Type and GlobalId is Exist.
But, in source code, ifcTypeResult's ok_ is false.