Got a minute? We appreciate your feedback:

Graphisoft Learn survey
Archicad C++ API
About Archicad add-on development using the C++ API.

Creating assosiative dimensions



I'm trying to create an associated dimensions in a wall, without success yet...

I'm following the "Do_CreateAssociativeDimensions" under "Element_Basic" in the Element_Test example, and I saw there that the function creates a dimension on the narrow part of the wall while I try to create a dimension on the long part of the wall. In addition, I tried to change the inindex which didn't help me too much... I did not understand why the numbers 11 and 21 were used inside the inindex function (in the example), what these specific numbers represent, and how I am supposed to understand what numbers I should use to create a dimension on the long part of the wall?

Windows 11, Visual Studio 2019, ArchiCAD 26, C++



Hi Yahavsa,


To get the information you need, I think it's best to make the element you want manually and then do ACAPI_Element_Get and ACAPI_Element_GetMemo to investigate the data of which it is composed. This way I found that you can make a dimension along the wall reference line the following way.


  1. In function AssociativeDimensionsOnWallThickness::Create () replace the relevant lines with:
    // length dim
    const API_Coord dimRefPoint { 0, 0 };
    const API_Vector dimDirection { 0, 1 };	// parallel to wall
  2. In function CreateDimension change the following lines to:
    dimElem.base.base.line = false;
    dimElem.base.base.inIndex = (dimElemIdx == 0) ? 1 : 2;
    dimElem.base.base.special = 1;


This also fits with the documentation of the Wall Neigs.

Unfortunately I wasn't able to figure out why numbers 11 and 21 are used for inIndex for the wall thickness.

Hope that helps!


Bernd Schwarzenbacher - Archicad Add-On Developer - (Add-On Downloads & Articles)

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!