cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

The 2025 Technology Preview Program is now live. Join today!

Archicad C++ API
About Archicad add-on development using the C++ API.

I have problem in upgrade AC26 to AC28

YONGWOO KIM
Participant

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?

3 REPLIES 3
Hiromichi Shinkawa
Graphisoft
Graphisoft

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.

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();
	}
}

 

Zoltan Vale
Graphisoft
Graphisoft

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.

Zoltán Válé
GRAPHISOFT Product Manager

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!