June 26, 2019
by Tibor Lorántfy
modified at July 19, 2019

New API features in ARCHICAD 23

This outline summarizes the major new features and changes in the API available with ARCHICAD 23.

  1. Technical changes
    • [Windows only] ARCHICAD 23 uses the Visual Studio 2017 toolset for building Add-On projects.
      Do not worry, you can use Visual Studio 2019 also for building! Make sure to set “Visual Studio 2017 (v141)” as platform toolset in the project properties!
    • [macOS only] Minimal macOS version is 10.12.
    • GRC resource converter is not supporting anymore GBMP or using .bmp files with GICN resources.
      This also means that GICN resource does not handle the transparent RGB values anymore, because those values were required only for the BMP image handling. Make sure to delete those values from the GCR files to eliminate compilation issues!
    • ACAP_DLL.apx and related mechanisms have been removed.
    • Attribute index references are replaced with the new API_AttributeIndex type. So now it’s Int32 instead of short.
  2. New functionality
    • Beams and Columns are now hierarchial elements like Curtain Walls, Stairs and Railings (they consist of a single or multiple segments).
    • Openings / Engineering voids can be created with the new Opening tool. Use API_OpeningType structure to access the parameters of the Openings and ACAPI_Element_GetConnectedElements function to get the connected elements. Currently adding new elements to an opening is not available via API, and the opening tool cannot penetrate objects, it’s a limitation.
    • Classifications & Properties for Building Materials similar to Element Classifications and Properties
    • Dialog Manager modul was extended with a Browser control. Use the Browser keyword in your 'GDLG' resource in the GRC file and the DG::Browser C++ class to use the new control.
  3. Modified/new functions
    • GSHandle parameters are GS::Array-s in many functions. This change causes many compilation errors during migration of old Add-On code to API 23, but don’t panic, it’s easy to fix them! Here’s an example:
      Before AC23, ACAPI_Element_Delete could be used only by using GSHandle.

      API_Elem_Head** elemHead = (API_Elem_Head **) BMAllocateHandle (sizeof (API_Elem_Head), ALLOCATE_CLEAR, 0);
      (*elemHead)[0].guid   = element.header.guid;
      ACAPI_Element_Delete (elemHead, 1);
      BMKillHandle ((GSHandle *) &elemHead);

      Since AC23, ACAPI_Element_Delete can be used by using GS::Array. This example initializes the GS::Array<API_Guid> with initializer list (C++11 feature).

      ACAPI_Element_Delete ({ element.header.guid });
    • Before ARCHICAD 23 if ACAPI_Element_Delete was called with nullptr (empty GSHandle) then the current selected elements were deleted. Since ARCHICAD 23 if you call ACAPI_Element_Delete with an empty GS::Array then nothing will happen, the new ACAPI_Element_DeleteSelected function can be used to delete the current selected elements.
    • Before ARCHICAD 23 if ACAPI_Element_Select was called with nullptr (empty GSHandle) then it deselected all previously selected elements. Since ARCHICAD 23 if you call ACAPI_Element_Select with an empty GS::Array then nothing will happen, the new ACAPI_Element_DeselectAll function can be used for this purpose.
    • Use the new APIAny_GetHierarchicalElementOwnerID function to return the owner of the child element in a hierarchical element structure (like Curtain Wall, Stair, Railing, Beam, Column etc.).