2025-08-01 09:12 AM - edited 2025-08-04 02:14 AM
First of all, when viewed in ArchiCAD 28, the IFC property values are generated correctly.
The property set name is 'BIMLOGI', which is the property I created in the add-in.
This property is created correctly in both debug and release modes.
However, there is a problem when saving this as an IFC file.
If I create an IFC property in Debug mode and save it, the value exists when I open the IFC.
If I create an IFC property in Release mode and save it, the value doesn't exist when I open the IFC.
I can't even find the property set name 'BIMLOGI'.
This image shows the property values when I open an IFC file saved in Debug mode.
The values may be different from the picture above, but these are the correct Property values for the object selected for capture.
This image shows the property values when I open an IFC file saved in Release mode.
The original .pln file contains property values, but I can't even find the property set name 'BIMLOGI'.
If I manually edit the values in "Manage IFC Properties...", there will be no issues when saving as an IFC file, even in Release mode.
I thought there was a problem with generating IFC properties in Release mode.
But even after debugging, the ErrCode of 'ACAPI_Element_SetIFCProperty' is NoError.
This is my code for create ifc property.
There were no problems with AC24 and AC26.
bool CUtility::CreateIFCProperty(API_Guid elemGuid, UniString ifcSetName, UniString ifcName, UniString ifcContent) {
API_IFCProperty ifcProp;
ifcProp.head.propertySetName = ifcSetName;
ifcProp.head.propertyName = ifcName;
ifcProp.head.propertyType = API_IFCPropertySingleValueType;
ifcProp.head.readOnly = false;
ifcProp.singleValue.nominalValue.valueType = L"IfcText";
ifcProp.singleValue.nominalValue.value.primitiveType = API_IFCPropertyAnyValueStringType;
ifcProp.singleValue.nominalValue.value.stringValue = ifcContent;
GSErrCode err = ACAPI_Element_SetIFCProperty(elemGuid, ifcProp);
if (err == NoError)
return true;
else
return false;
}
Is there any solution?
2025-08-12 06:02 PM - edited 2025-08-12 06:05 PM
The documentation for API_IFCPropertyAnyValue states:
"The `primitiveType` field is an output parameter only, shall not be set when setting up a new @ref API_IFCPropertyValue structure."
I recommend removing this line for a start:
ifcProp.singleValue.nominalValue.value.primitiveType = API_IFCPropertyAnyValueStringType;
Also note that ACAPI_Element_SetIFCProperty is marked as deprecated - I recommend moving to the new IFC API as soon as you are able.
2025-08-18 08:37 AM
Thank you for your reply.
I was able to confirm that the property exists when saving as IFC by removing the line that sets the primitiveType using the method you suggested.
However, only the IFC property exists, and the value isn't exported.
Could you also confirm the part where the value is modified?
bool CUtility::ChangeIFCProperty(API_Guid elemGuid, UniString ifcSetName, UniString ifcName, UniString ifcContent) {
GS::Array<API_IFCProperty> properties;
ACAPI_Element_GetIFCProperties(elemGuid, false, &properties);
GSErrCode errCode = Error;
for (int i = 0; i < properties.GetSize(); i++) {
if (properties[i].head.propertySetName.Compare(ifcSetName) == UniString::CompareResult::Equal
&& properties[i].head.propertyName.Compare(ifcName) == UniString::CompareResult::Equal) {
properties[i].singleValue.nominalValue.value.stringValue = ifcContent;
errCode = ACAPI_Element_SetIFCProperty(elemGuid, properties[i]);
}
}
if (errCode == NoError)
return true;
else
return false;
}
This is property window before save as .ifc file.
This is ifc property in ifc viewer.
Also, I can't find the new IFC API. Where should I find it?
The API documentation says, "Deprecated function, will be deleted in the upcoming version!" but doesn't tell me where to refer to it.
2025-08-19 09:30 PM
If the properties are appearing in element settings dialogs, I can't think of anything related to the API that would prevent that from exporting with an IFC file - perhaps someone else can suggest a cause?
The documentation for ACAPI_Element_SetIFCProperty says:
"See IFCAPI::v1::RegisterPropertyHook for dynamic property manipulation with hooks."
You can find the new IFC API in the dev-kit path: Support/Modules/IFCInOutAPI/ACAPI
There are also example IFC projects in the dev-kit.
2025-09-25 10:29 AM
Hi,
Initializing the new property before setting its fields may help with the release/debug difference.
API_IFCProperty ifcProp = {};
Also, could you please test the example code that adds an IFC property?
Examples/IFCHook_Test/Src/IFCHook_Test.cpp is a good starting point.
Best, Ákos
a month ago - last edited a month ago
Hello. Thank you for your reply.
I checked the Examples/IFCHook_Test/Src/IFCHook_Test.cpp you suggested, but for my current situation, I need to continue using ACAPI_Element_SetIFCProperty. If ACAPI_Element_SetIFCProperty is technically unavailable in AC28 or removed in the future, I'll have to replace it, but until then, I'm going to use it.
I initialized the new property, but I'm still having the same issue.
Here's the file I modified and used. Could you please check it?
Is there a solution?
bool CUtility::ChangeIFCProperty(API_Guid elemGuid, UniString ifcSetName, UniString ifcName, UniString ifcContent) {
GS::Array<API_IFCProperty> properties;
API_IFCProperty ifcProperty = {};
ACAPI_Element_GetIFCProperties(elemGuid, false, &properties);
GSErrCode errCode = Error;
for (int i = 0; i < properties.GetSize(); i++) {
if (properties[i].head.propertySetName.Compare(ifcSetName) == UniString::CompareResult::Equal
&& properties[i].head.propertyName.Compare(ifcName) == UniString::CompareResult::Equal) {
ifcProperty = properties[i];
ifcProperty.singleValue.nominalValue.value.stringValue = ifcContent;
errCode = ACAPI_Element_SetIFCProperty(elemGuid, ifcProperty);
}
}
// Previous
/*GS::Array<API_IFCProperty> properties;
ACAPI_Element_GetIFCProperties(elemGuid, false, &properties);
GSErrCode errCode = Error;
for (int i = 0; i < properties.GetSize(); i++) {
if (properties[i].head.propertySetName.Compare(ifcSetName) == UniString::CompareResult::Equal
&& properties[i].head.propertyName.Compare(ifcName) == UniString::CompareResult::Equal) {
properties[i].singleValue.nominalValue.value.stringValue = ifcContent;
errCode = ACAPI_Element_SetIFCProperty(elemGuid, properties[i]);
}
}*/
if (errCode == NoError)
return true;
else
return false;
}
3 weeks ago
Hi @YONGWOO KIM,
Just a rough guess: Is it possible that you have set the the export IFC translator to a different one than your IFC Preview Translator?
I think it would be possible that your IFC property is somehow excluded by the actual IFC translator settings, but you see it in the Tool Box if you have set up a different IFC Preview translator.
If that's not the case, then I'll give it a try to run your code.
Best regards,
Bernd
2 weeks ago
Hello.
I tried changing the IFC Translator, but the same issue persists.
There's a feature called Property Mapping, so I tried that, but it didn't resolve the issue.
I've attached a photo.
I created the ifc property using CreateIFCProperty and then modified it using ChangeIFCProperty.
Could you please test it?
Wednesday
Hi @YONGWOO KIM,
I've slightly adapted and tested your CreateIFCProperty code (in Debug mode only) and came to almost the same conclusion as you:
The IFCProperty was created but no value was actually in it once saved to an .ifc file.
I've tried a few things. It seems to work after setting "ifcProp.singleValue.nominalValue.value.hasValue = true".
Here's my very similar code that works for me. Please try it:
GSErrCode CreateIFCProperty (API_Guid elemGuid, GS::UniString ifcSetName, GS::UniString ifcName, GS::UniString ifcContent)
{
API_IFCProperty ifcProp{};
ifcProp.head.propertySetName = ifcSetName;
ifcProp.head.propertyName = ifcName;
ifcProp.head.propertyType = API_IFCPropertySingleValueType;
ifcProp.head.readOnly = false;
ifcProp.singleValue.nominalValue.valueType = L"IfcText";
ifcProp.singleValue.nominalValue.value.stringValue = ifcContent;
ifcProp.singleValue.nominalValue.value.hasValue = true;
return ACAPI_CallUndoableCommand ("IFCTest", [&]() {
return ACAPI_Element_SetIFCProperty (elemGuid, ifcProp);
});
}
This might also explain the difference in Debug & Release build before. 'hasValue' might have been set to 'true' in one of the cases, if you don't specifically 0-initialize the structure (as suggested by Akos). But that's just a wild guess from me.
Please report back if this solved your issue.
Bernd
Bernd