2024-01-05 11:58 AM - last edited on 2024-09-16 02:58 PM by Doreena Deng
Hello all,
We have been developing an Add-on using dev kit version 25 and Archicad 25. The same code was built successfully with ArchiCAD devkit 26 and we could load it successfully in ArchiCAD 26.
However, for version 27, the build with devkit 27 was successful but the add-on is not being loaded. Anything that we should be considering?
2024-01-08 11:07 AM - edited 2024-01-08 11:08 AM
Hi Kency,
Here are a few things that changed that you might want to double check:
This is all I can think of for now. If none of this works, maybe you can reduce your Add-On to a minimal example (remove all code with functionality, just leave in the barebones Add-On structure with your compilation setup) that you can share for us to debug.
Best,
Bernd
2024-01-16 02:30 PM
I think I was doing it incorrectly earlier. When I tried now the compilation failed. Meanwhile, I was checking the CMake template project that ArchiCAD provides https://github.com/GRAPHISOFT/archicad-addon-cmake
What does the RFIX* and RINT folders mean?
2024-01-16 02:56 PM
To my knowledge the R stands for "Resources".
RFIX are fixed resources. In the sense that they are independent of the language.
So there are RFIX.win fixed resources for Windows and RFIX.mac fixed resources for macOS.
RINT are resources localized to an international language version (analogous to Archicad INT version).
2024-01-24 12:25 PM - edited 2024-01-24 12:26 PM
Sharing the mistakes and changes that I did so that it helps someone else.
cmake -B Build27 -G "Xcode" -DAC_API_DEVKIT_DIR=/Applications/Graphisoft\ Archicad\ API\ DevKit\ 27.3001/Support -DAC_ADDON_NAME=AddOn .
MigrationUtils.hpp
#ifndef MIGRATIONUTILS_HPP
#define MIGRATIONUTILS_HPP
#include "ACAPinc.h"
#if defined(ServerMainVers_2700)
#include "MigrationHeader27.hpp"
#endif
void SetAPIElementType (API_Element& element, API_ElemTypeID elemTypeId);
API_AttributeIndex GetAttributeIndex(Int32 index);
bool IsAttributeIndexPositive(API_AttributeIndex index);
API_OverriddenAttribute GetOverriddenAttribute(API_AttributeIndex attrIndex);
#endif
MigrationUtils.cpp
#include "MigrationUtils.hpp"
void SetAPIElementType (API_Element& element, API_ElemTypeID elemTypeId)
{
#ifdef ServerMainVers_2600
element.header.type = API_ElemType (elemTypeId);
#else
element.header.typeID = elemTypeId;
#endif
}
API_AttributeIndex GetAttributeIndex(Int32 index) {
#ifdef ServerMainVers_2700
return ACAPI_CreateAttributeIndex(index);
#else
return index;
#endif
}
bool IsAttributeIndexPositive(API_AttributeIndex index) {
#ifdef ServerMainVers_2700
return index.IsPositive();
#else
return index > 0;
#endif
}
API_OverriddenAttribute GetOverriddenAttribute(API_AttributeIndex attrIndex) {
#ifdef ServerMainVers_2700
APIOptional<API_AttributeIndex> optional = {};
optional.value = attrIndex;
optional.hasValue = true;
return optional;
#else
API_OverriddenAttribute overriddenAttribute = {};
overriddenAttribute.attributeIndex = attrIndex;
overriddenAttribute.overridden = true;
return overriddenAttribute;
#endif
}
Let me know if there is any other better approach 🙂