2021-07-06 12:03 PM - last edited on 2021-09-14 09:29 AM by Noemi Balogh
Solved! Go to Solution.
2021-07-13 03:12 PM
YongWoo wrote:From Archicad 24 the columns can have multiple segments. Each segment can have different parameters, building materials. So the building material parameter belongs to the segments and not to the column itself.
I found that at API_ColumnSegmentType. But I don't know how to change this.
API_ElementMemo memo = {}; ACAPI_Element_GetMemo (element.header.guid, &memo, APIMemoMask_ColumnSegment); if (memo.columnSegments != nullptr) { for (UIndex idx = 0; idx < element.column.nSegments; ++idx) { API_ColumnSegmentType& columnSegment = memo.columnSegments[idx]; // modify attributes of columnSegment here } API_Element maskElem; ACAPI_ELEMENT_MASK_CLEAR (maskElem); // change only the parameters of the segments ACAPI_Element_Change (&element, &maskElem, &memo, APIMemoMask_ColumnSegment, true); }
2021-07-13 03:12 PM
YongWoo wrote:From Archicad 24 the columns can have multiple segments. Each segment can have different parameters, building materials. So the building material parameter belongs to the segments and not to the column itself.
I found that at API_ColumnSegmentType. But I don't know how to change this.
API_ElementMemo memo = {}; ACAPI_Element_GetMemo (element.header.guid, &memo, APIMemoMask_ColumnSegment); if (memo.columnSegments != nullptr) { for (UIndex idx = 0; idx < element.column.nSegments; ++idx) { API_ColumnSegmentType& columnSegment = memo.columnSegments[idx]; // modify attributes of columnSegment here } API_Element maskElem; ACAPI_ELEMENT_MASK_CLEAR (maskElem); // change only the parameters of the segments ACAPI_Element_Change (&element, &maskElem, &memo, APIMemoMask_ColumnSegment, true); }
2021-07-19 08:44 AM
2021-09-10 12:27 AM - last edited on 2021-09-10 03:38 PM by Laszlo Nagy
@Tibor Lorantfy can you post some code to demonstrate how to change a rectangle column segment (only one segment) section size, ie:400x600, I'm new to develop C++ add-on, adding some columns to Archicad 24, but different section size
void Do_CreateColumn (void) //创建柱
{
API_Coord point;
if (!ClickAPoint ("请点取要放置柱的点.", &point)) {
return;
}
API_Element element;
API_ElementMemo memo;
BNClear (element);
BNClear (memo);
element.header.typeID = API_ColumnID; //设置为柱
GSErrCode err = ACAPI_Element_GetDefaults (&element, &memo); //获取柱当前设置
if (err != NoError) {
ACAPI_WriteReport ("ACAPI_Element_GetDefaults (Column) has failed with error code %ld!", true, err);
ACAPI_DisposeElemMemoHdls (&memo);
return;
}
element.column.origoPos = point;
element.column.bottomOffset = -0.05;
element.column.topOffset = -0.05;
// element.column.height = 3.0;
// element.column.nSegments
err = ACAPI_Element_Create (&element, &memo); //创建柱
if (err != NoError) {
ACAPI_WriteReport ("ACAPI_Element_Create (Column) has failed with error code %ld!", true, err);
//How to change section size?
//please put some code here
}