cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
Archicad C++ API
About Archicad add-on development using the C++ API.
SOLVED!

How to change 'materialsChained' false to true with custum section beam?

HKM
Contributor

Windows10 Archicad26 APIDevKit 26.3000

beamSegment not has 'extrusionSurfaceMaterial' property
then beam with custum section can't change 'materialsChained' property false to true.

How to change 'materialsChained' property false to true with beam with custum section in C++?;

1 ACCEPTED SOLUTION

Accepted Solutions
Solution
LChen
Graphisoft
Graphisoft

No, you're right, it's a limitation of the current SDK. I don't know whether an updated SDK can be released for AC27, but it will be solved in AC28 SDK officially.

HTH

View solution in original post

8 REPLIES 8
HKM
Contributor

It seems that "Do_TestMaterialChaining" in the SDK sample "Element_Test" is not working properly.
Is this a misunderstanding on my part?
It would be helpful if you could at least give me a hint.

Hi HKM,

 

Yes extrusionSurfaceMaterial is only available for Column Segments.

But Beam Segments can actually override each side separately, that's why there are all the different sides available as overrides (leftMaterial, rightMaterial....).

See the documentation of API_BeamSegmentType. This also matches the options in the beam segment settings.

And there is a materialsChanged property in beam segments that chains or unchains the 5 different sides overrides of the beam.

So to my understanding also the Do_TestMaterialChaining example is correct. (It's a bit weird because it "inverts" the chain instead of setting it to a fixed "chained" or "unchained" value)

 

Hope that helps,
Bernd

Bernd Schwarzenbacher - Archicad Add-On Developer - Get Add-Ons & Archicad Tips on my Website: Archi-XT.com

Custom section beams do not match description.
For custom sections, 'Extruded material'(translated from Japanese) is displayed at the top of the material.

CustumSectionBeam.jpg

HKM
Contributor

Check before and after segmentation.

use "Do_TestMaterialChaining()" of SDK Example "Element_Test".

Archicad 22 (before segmentation)
modified to "overridden = true" for all materials(side/bottom/left/right/right/top).

case API_BeamID:
ACAPI_ELEMENT_MASK_SET (mask, API_BeamType, materialsChained);
ACAPI_ELEMENT_MASK_SET (mask, API_BeamType, sideMat);
chainingValue = &element.beam.materialsChained;
element.beam.sideMat.attributeIndex = 19;
element.beam.sideMat.overridden = true;
ACAPI_ELEMENT_MASK_SET (mask, API_BeamType, botMat);
element.beam.botMat.attributeIndex = 19;
element.beam.botMat.overridden = true;
ACAPI_ELEMENT_MASK_SET (mask, API_BeamType, leftMat);
element.beam.leftMat.attributeIndex = 19;
element.beam.leftMat.overridden = true;
ACAPI_ELEMENT_MASK_SET (mask, API_BeamType, rightMat);
element.beam.rightMat.attributeIndex = 19;
element.beam.rightMat.overridden = true;
ACAPI_ELEMENT_MASK_SET (mask, API_BeamType, topMat);
element.beam.topMat.attributeIndex = 19;
element.beam.topMat.overridden = true;
//--------------------------------
Result
Extrusion side surface material is chenged

//--------------------------------
Archicad24 (after segmentation)
modified to "overridden = true" for all materials(left/right/top/bottom/ends).
case API_BeamID:
BNZeroMemory (&memo, sizeof (API_ElementMemo));
err = ACAPI_Element_GetMemo (element.header.guid, &memo, APIMemoMask_BeamSegment);
for (USize idx = 0; idx < element.beam.nSegments; ++idx) {
chainingValue = &memo.beamSegments[idx].materialsChained;
memo.beamSegments[idx].leftMaterial.attributeIndex = 19;
memo.beamSegments[idx].leftMaterial.overridden = true;
memo.beamSegments[idx].rightMaterial.attributeIndex = 19;
memo.beamSegments[idx].rightMaterial.overridden = true;
memo.beamSegments[idx].topMaterial.attributeIndex = 19;
memo.beamSegments[idx].topMaterial.overridden = true;
memo.beamSegments[idx].bottomMaterial.attributeIndex = 19;
memo.beamSegments[idx].bottomMaterial.overridden = true;
memo.beamSegments[idx].endsMaterial.attributeIndex = 19;
memo.beamSegments[idx].endsMaterial.overridden = true;
*chainingValue = !*chainingValue;
}
API_Element maskElem;
ACAPI_ELEMENT_MASK_CLEAR (maskElem);
err = ACAPI_Element_Change (&element, &maskElem, &memo, APIMemoMask_BeamSegment, true);



Result
Extrusion side surface material is not chenged

B20240206.jpg

HKM
Contributor

Does anyone other than me have this problem?
Or am I misunderstanding something?
Any advice would be helpful.

LChen
Graphisoft
Graphisoft

Hi,

If your problem is you're not able to change the profile beam side material with API, then it's true.

HTH.

Thank you.
So does that mean I'm wrong?
Or is this a bug in the SDK that will be fixed?

Solution
LChen
Graphisoft
Graphisoft

No, you're right, it's a limitation of the current SDK. I don't know whether an updated SDK can be released for AC27, but it will be solved in AC28 SDK officially.

HTH

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!