2020-06-1102:19 AM - last edited on 2021-09-1502:48 AM by Noemi Balogh
We are currently developping an addons for Archicad. However, we have still issues despite the documentation and examples. Our issues: 1- Property Group: We cannot create new Property Group even if it's working with the addon example Property_Test API_PropertyGroup group; group.guid = APINULLGuid; group.name = "datBIM" + GenerateUniqueName(); ACAPI_Property_CreatePropertyGroup(group); => Not Working 2- Attribute Property: We cannot create new Property for Attributes with ACAPI_Attribute_SetProperty(attrib.header, property); even if it's working with Elements with ACAPI_ElementList_AddProperty(definition, guidList);
I have the following errors:
1/ ACAPI_Property_CreatePropertyGroup return => APIERR_NEEDSUNDOSCOPE even if we use ACAPI_CallUndoableCommand in __ACENV_CALL MenuCommandHandler
2/ ACAPI_Attribute_SetProperty return => APIERR_BADID (same process than TestPropertiesOnAttribute () in Property_Test, the Building Materials are successfully created but it is not possible to add them properties)
Our project is based on the Browser_Control project.
Are you certain ACAPI_Property_CreatePropertyGroup is called within the scope of ACAPI_CallUndoableCommand? The error strongly suggests it isn't - we use this function successfully in a number of add-ons.
I can't comment on ACAPI_Attribute_SetProperty – we haven't used it for anything yet. I have some recollection that properties attached to attributes are still limited compared to elements, but I can't remember the specifics.