We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2021-09-12 08:01 AM - last edited on 2021-09-14 08:25 AM by Noemi Balogh
I can create a rectangle column, but don't know how to change section width and height, AC24:
void Do_CreateColumn (void)
{
API_Coord point;
if (!ClickAPoint ("Pick a point", &point)) {
return;
}
API_Element element;
API_ElementMemo memo;
BNClear (element);
BNClear (memo);
element.header.typeID = API_ColumnID; // set as a column
GSErrCode err = ACAPI_Element_GetDefaults (&element, &memo); //get current setting
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.axisRotationAngle = 45; //rotate
memo.elemInfoString = new GS::UniString("KZ-1"); //uset ID
err = ACAPI_Element_Create (&element, &memo); //create the column
if (err != NoError) {
ACAPI_WriteReport ("ACAPI_Element_Create (Column) has failed with error code %ld!", true, err);
}
char buffer[65];
sprintf(buffer, "%s%d", "Column Segment:", element.column.nSegments); //1 segment in fact
MessageBox(NULL, buffer, "Grand", 0); //display how many segments
//modify section width and height ACAPI_CallUndoableCommand 进程中-----------------------------
????how to change the section width and height of this column ???
ACAPI_DisposeElemMemoHdls (&memo);
} // Do_CreateColumn
Solved! Go to Solution.
2021-09-13 06:58 AM
I had to go back and look at my notes and still didn't figure it out. I don't know how the define a segment column and a column without segments.
But you can use a single segment column by using the memo fields and set nsegments as 1;
then use:
element.header.typeID = API_ColumnID;
GSErrCode err = ACAPI_Element_GetDefaults (&element, &memo);
element.column.origoPos = point;
element.column.nSegments = 1;
memo.columnSegments[0].assemblySegmentData.buildingMaterial = ??;
memo.columnSegments[0].assemblySegmentData.nominalHeight = ??;
memo.columnSegments[0].assemblySegmentData.nominalWidth = ??;
memo.columnSegments[0].assemblySegmentData.modelElemStructureType = API_BasicStructure; or ???
For more nsegments change the index of columnsegment in memo
2021-09-13 06:58 AM
I had to go back and look at my notes and still didn't figure it out. I don't know how the define a segment column and a column without segments.
But you can use a single segment column by using the memo fields and set nsegments as 1;
then use:
element.header.typeID = API_ColumnID;
GSErrCode err = ACAPI_Element_GetDefaults (&element, &memo);
element.column.origoPos = point;
element.column.nSegments = 1;
memo.columnSegments[0].assemblySegmentData.buildingMaterial = ??;
memo.columnSegments[0].assemblySegmentData.nominalHeight = ??;
memo.columnSegments[0].assemblySegmentData.nominalWidth = ??;
memo.columnSegments[0].assemblySegmentData.modelElemStructureType = API_BasicStructure; or ???
For more nsegments change the index of columnsegment in memo
2021-09-13 11:43 AM
thank you very much,it works fine!
Great!