Archicad C++ API
About Archicad add-on development using the C++ API.
SOLVED!

Archicad API QUESTION

Ilse J
Participant
Hi,

I've got an question about the Archicad API element Quantities.

In the API_WallQuantity you can choose:
- skinAThickness: Wall skin thickness on the reference line side
- skinBThickness: Wall skin thickness on the side opposite to the reference line

We need the thickness of the inside part( the load-bearing part/skin of the wall) to go further with...

But with the parameters above it really depends on where you reference line is in the wall...

So I was wondering if there is a parameter in the API that I can use that for example search for the building material of the inside skin and than give the thickness of that part. Or is there a general thickness I can link to that part of the wall...

I hope anyone has experience with this and can help us out.

thanks in advance!

Kind regards

Ilse J
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Tibor Lorantfy
Graphisoft Alumni
Graphisoft Alumni
Hi Ilse,

I wrote you a short example code:
API_Attribute composite;
BNZeroMemory (&composite, sizeof(API_Attribute));
composite.header.typeID = API_CompWallID;
composite.header.index  = element.wall.composite;

GSErrCode err = ACAPI_Attribute_Get (&composite);
if (err == NoError) {
	API_AttributeDefExt	compDefs;
	BNZeroMemory (&compDefs, sizeof (API_AttributeDefExt));

	err = ACAPI_Attribute_GetDefExt (API_CompWallID, composite.header.index, &compDefs);
	if (err == NoError) {
		// enumerate the parts
		for (short ii = 0; ii < composite.compWall.nComps; ++ii) {
			API_CWallComponent& part = (*compDefs.cwall_compItems)[ii];
			part.buildingMaterial;	/**< index of the building material */
			part.fillThick;			/**< absolute thickness of the component in m	*/
		}
		// after you modified the thickness you can save it using ACAPI_Attribute_ModifyExt
	}
	ACAPI_DisposeAttrDefsHdlsExt (&compDefs);
}
If you have any further questions, feel free to ask me!

Regards,
Tibor

View solution in original post

2 REPLIES 2
Solution
Tibor Lorantfy
Graphisoft Alumni
Graphisoft Alumni
Hi Ilse,

I wrote you a short example code:
API_Attribute composite;
BNZeroMemory (&composite, sizeof(API_Attribute));
composite.header.typeID = API_CompWallID;
composite.header.index  = element.wall.composite;

GSErrCode err = ACAPI_Attribute_Get (&composite);
if (err == NoError) {
	API_AttributeDefExt	compDefs;
	BNZeroMemory (&compDefs, sizeof (API_AttributeDefExt));

	err = ACAPI_Attribute_GetDefExt (API_CompWallID, composite.header.index, &compDefs);
	if (err == NoError) {
		// enumerate the parts
		for (short ii = 0; ii < composite.compWall.nComps; ++ii) {
			API_CWallComponent& part = (*compDefs.cwall_compItems)[ii];
			part.buildingMaterial;	/**< index of the building material */
			part.fillThick;			/**< absolute thickness of the component in m	*/
		}
		// after you modified the thickness you can save it using ACAPI_Attribute_ModifyExt
	}
	ACAPI_DisposeAttrDefsHdlsExt (&compDefs);
}
If you have any further questions, feel free to ask me!

Regards,
Tibor
Ilse J
Participant
Dear Tibor,

Thank you very much! We are going to try this one and if I have further question, I will contact you, thank you!


With kind regards,

Ilse