New API features in Archicad 27
This outline summarizes the major new features and changes in the API available with Archicad 27.
System requirements changes
Technical changes
There were several major changes in the API in Archicad 27.
- The name of many functions were changed to better match the logical groups and places of the functions, ensuring a more intuitive API structure and consistent naming conventions.
- The grouped functions like ACAPI_Database, ACAPI_Navigator, and ACAPI_Automate were split to separate functions. This change made it possible to use typed parameters with logical names instead of void pointers.
- The new parts of the (see MEP Element Manager) API were created with a new concept. Instead of the old C-like functions and structures we pledged to develop a state-of-the-art C++ API that supports compile-time error detection for many errors that were previously detectible only during runtime. This new technology also offers more control for the developer than the old, sometimes overbearing functions. From now on, we will work on this new C++ API. The old API will still be available in future releases, but it will be in maintenance mode and no new features or serious changes will be implemented there. Note, that the new API works well with the old one, so you can use it in your AddOn alongside the old functions.
- In order to ease the version change for AddOn developers, we created a header (in the Support/Inc folder) which matches the old function names with the new names. Including this header in your files will enable you to compile and run your AddOn without changing the function names and parameter types on the calling side.
- With these changes as a first step we plan to reinvigorate our API, to extend the possibilities of AddOn developers and lower the entry-level of Archicad AddOn development.
New functionality
- API_IMarqueeEventHandler ⇒ Notifications for marquee changes.
- We introduced grouping and ordering to Graphical Override Rules. This also affects the name requirements, since now a Rule's name is only unique within its Group. The Graphical Override Rule Groups have unique names. There is also a built-in Rule Group that can't be modified or deleted and contains built-in Rules.
- New MEP API for managing MEP elements (for details please see MEP Element Manager)
Modified/new structures
- API_DimensionType ⇒ new
textFillOrder
attribute that describes the drawing order of the text's fill and contour relative to the dimension line.
- API_DimTextFillOrderID ⇒ new structure that describes the drawing order of the text's fill and contour regards to the dimension.
- API_AttributePickerParams ⇒ now provides support for fill and line types.
- API_OverrideRuleGroup ⇒ new structure that describes the Groups for Graphic Override Rules.
Modified/new functions
- The following API_Attribute related functions return
APIERR_BADINDEX
instead of APIERR_DELETED
⇒ ACAPI_Attribute_AddClassificationItem, ACAPI_Attribute_Get, ACAPI_Attribute_GetClassificationInSystem, ACAPI_Attribute_GetClassificationItems, ACAPI_Attribute_GetDef, ACAPI_Attribute_GetDefExt, ACAPI_Attribute_GetPropertyDefinitions, ACAPI_Attribute_GetPropertyValue, ACAPI_Attribute_GetPropertyValues, ACAPI_Attribute_GetPropertyValuesByGuid, ACAPI_UserData_GetUserData, ACAPI_Attribute_Modify, ACAPI_Attribute_ModifyExt, ACAPI_Attribute_RemoveClassificationItem and ACAPI_Attribute_SetProperty
- ACAPI_Attribute_EnumerateAttributesByType ⇒ new function that iterates the instances of a given attribute type in the database.
- ACAPI_Attribute_GetAttributesByType ⇒ new function that returns the instances of a given attribute type in the database.
- ACAPI_Drawing_Update_Drawings ⇒ triggers a manual update of the specified drawings.
- ACAPI_GraphicalOverride_GetOverrideRuleGroupList ⇒ new function to query all Graphical Override Rule Groups.
- ACAPI_GraphicalOverride_GetOverrideRuleGroup ⇒ new function to get the data and contained rules of a Graphical Override Rule Group.
- ACAPI_GraphicalOverride_CreateOverrideRuleGroup ⇒ new function to create a new Graphical Override Rule Group.
- ACAPI_GraphicalOverride_ChangeOverrideRuleGroup ⇒ new function to change the data of a Graphical Override Rule Group.
- ACAPI_GraphicalOverride_DeleteOverrideRuleGroup ⇒ new function to delete a Graphical Override Rule Group.
- ACAPI_GraphicalOverride_SetOverrideRuleGroupOrder ⇒ new function to order the Graphical Override Rule Groups.
- ACAPI_GraphicalOverride_SetOverrideRuleOrder ⇒ new function to order the Graphical Override Rules within a Graphical Override Rule Group.
- ACAPI_GraphicalOverride_GetOverrideRule ⇒ separated into ACAPI_GraphicalOverride_GetOverrideRuleById and ACAPI_GraphicalOverride_GetOverrideRuleByName, because a Graphical Override Rule's name is no longer unique in the whole database, so a Graphical Override Rule Group needs to be specified when looking for a Rule by its name.
- ACAPI_GraphicalOverride_CreateOverrideRule ⇒ requires a Graphical Override Rule Group, because a Graphical Override Rule can only exist within a Group.
- ACAPI_GraphicalOverride_MoveOverrideRule ⇒ new function to move a Graphical Override Rule to another Graphical Override Rule Group (and optionally set its place within the order of Rules in that Group).
Please note: writing elements in raw binary format (for example, storing raw structures in API_ModulData's dataHdl field) is not supported. Please use the dedicated serialization functionality of the API to do this.