2023-10-01 10:05 AM - last edited on 2024-09-16 02:23 PM by Doreena Deng
Hello,
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?
Thanks!
Windows 11, Visual Studio 2019, ArchiCAD 26, C++
Solved! Go to Solution.
2023-10-07 01:17 PM
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.
AssociativeDimensionsOnWallThickness::Create ()
replace the relevant lines with:// length dim
const API_Coord dimRefPoint { 0, 0 };
const API_Vector dimDirection { 0, 1 }; // parallel to wall
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
2023-10-07 01:17 PM
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.
AssociativeDimensionsOnWallThickness::Create ()
replace the relevant lines with:// length dim
const API_Coord dimRefPoint { 0, 0 };
const API_Vector dimDirection { 0, 1 }; // parallel to wall
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