2024-04-01 04:03 PM - last edited on 2024-09-17 01:12 PM by Doreena Deng
I want to set information into the building material parameter but can't. Can you help me ?
Solved! Go to Solution.
2024-04-01 04:26 PM
Hi Linh,
This looks like Attribute Properties to me. Check out this ACAPI_Attribute_SetProperties and the others around it.
Best,
Bernd
2024-04-01 04:09 PM - last edited on 2024-04-04 10:14 PM by Laszlo Nagy
Topic : I want to set information into the building material parameter but can't. Can you help me ?
I used the code below to create the building material
API_Attribute fill_atr;
API_AttributeDef fill_atrdef;
API_FillLine *fillLine;
API_Polygon *poly;
API_Coord *coords;
Int32 *subpoly;
double *lineLength;
GSErrCode err;
WriteReport ("# Create the following fill attributes:");
WriteReport ("# - solid: \"Training Solid\"");
WriteReport ("# - empty: \"Training Empty\"");
WriteReport ("# - vector: \"Training Vector\"");
WriteReport ("# - symbol: \"Training Symbol\"");
WriteReport ("# Archicad menus must be updated");
WriteReport ("# Check the \"Fill Types...\" dialog after execution");
// APIFill_Solid
fill_atr = {};
fill_atrdef = {};
fill_atr.header.typeID = API_FilltypeID;
fill_atr.header.flags = APIFill_ScaleWithPlan;
strcpy (fill_atr.header.name, "Training Solid");
fill_atr.filltype.subType = APIFill_Solid;
BNZeroMemory (fill_atr.filltype.bitPat, sizeof (API_Pattern));
err = ACAPI_Attribute_Create (&fill_atr, &fill_atrdef);
if (err == APIERR_ATTREXIST) { // This can not be modified
err = NoError;
}
ACAPI_DisposeAttrDefsHdls (&fill_atrdef);
if (err != NoError) {
WriteReport_Err ("Error while creating the solid fill", err);
} else {
WriteReport ("The solid fill \"Training Solid\" was created successfully!");
}
// APIFill_Empty
fill_atr = {};
fill_atr.header.typeID = API_FilltypeID;
fill_atr.header.flags = APIFill_ScaleWithPlan;
strcpy (fill_atr.header.name, "Training Empty");
fill_atr.filltype.subType = APIFill_Empty;
err = ACAPI_Attribute_Create (&fill_atr, &fill_atrdef);
if (err == APIERR_ATTREXIST) { // This can not be modified
err = NoError;
}
ACAPI_DisposeAttrDefsHdls (&fill_atrdef);
if (err != NoError) {
WriteReport_Err ("Error while creating the empty fill", err);
} else {
WriteReport ("The empty fill \"Training Empty\" was created successfully!");
}
Operating system used: Windows 27
2024-04-01 04:26 PM
Hi Linh,
This looks like Attribute Properties to me. Check out this ACAPI_Attribute_SetProperties and the others around it.
Best,
Bernd
2024-04-01 04:35 PM - edited 2024-04-02 10:59 AM
Thank you
2024-04-02 10:59 AM
@BerndSchwarzenbacher . I tried it . I think it works quite well . Thank you so much !