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

Change parameters in building Material

Linh
Contributor

I want to set information into the building material parameter but can't. Can you help me ?

 

Linh_0-1711980075764.png

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

Hi Linh,

This looks like Attribute Properties to me. Check out this ACAPI_Attribute_SetProperties and the others around it.

Best,
Bernd

View solution in original post

4 REPLIES 4
Linh
Contributor

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!");
}
 
But I want to assign parameter information as shown below, but I don't know how. Can you help me ?

 

Linh_0-1711980420391.png

 

 

Operating system used: Windows 27

Solution

Hi Linh,

This looks like Attribute Properties to me. Check out this ACAPI_Attribute_SetProperties and the others around it.

Best,
Bernd

Thank you 

Linh
Contributor

@BerndSchwarzenbacher  . I tried it . I think it works quite well . Thank you so much !