2018-10-05
12:42 PM
- last edited on
2022-10-05
01:37 PM
by
Daniel Kassai
void ModifyGlobParameters (const API_Guid &guid , const UInt32 index , const double &valD1 , const double &valD2 ) { API_ParamOwnerType paramOwner; API_ChangeParamType chgParam; API_GetParamsType getParams; GSErrCode err; BNZeroMemory (¶mOwner, sizeof (API_ParamOwnerType)); BNZeroMemory (&getParams, sizeof (API_GetParamsType)); paramOwner.libInd = index; // !!!! default parameters of a Library Part itself !!!! paramOwner.typeID = API_ObjectID; err = ACAPI_Goodies (APIAny_OpenParametersID, ¶mOwner, NULL); if (err == NoError) { BNZeroMemory (&chgParam, sizeof (API_ChangeParamType)); err = ACAPI_Goodies (APIAny_GetActParametersID, &getParams, NULL); if (err == NoError) { chgParam.index = 0; CHCopyC ("Global_ALL_SUMM_K", chgParam.name); chgParam.realValue = valD1; err = ACAPI_Goodies (APIAny_ChangeAParameterID, &chgParam, NULL); if (err == NoError) err = ACAPI_Goodies (APIAny_GetActParametersID, &getParams, NULL); chgParam.index = 0; CHCopyC ("Global_kSum", chgParam.name); chgParam.realValue = valD2; err = ACAPI_Goodies (APIAny_ChangeAParameterID, &chgParam, NULL); if (err == NoError) err = ACAPI_Goodies (APIAny_GetActParametersID, &getParams, NULL); } ACAPI_Goodies (APIAny_CloseParametersID, NULL, NULL); WriteReport ("All OK 1: %lf 2: %lf", (*getParams.params)[2].value.real , (*getParams.params)[3].value.real ); } if (err == NoError) { API_Element element; API_Element mask; API_ElementMemo memo; BNZeroMemory (&element, sizeof (API_Element)); BNZeroMemory (&memo, sizeof (API_ElementMemo)); ACAPI_ELEMENT_MASK_CLEAR (mask); guid; element.header.typeID = API_ObjectID; err = ACAPI_Element_GetDefaults (&element, &memo); ACAPI_ELEMENT_MASK_CLEAR (mask); ACAPI_ELEMENT_MASK_SET (mask, API_ObjectType, libInd); element.object.libInd = index; memo.params = getParams.params; //err =ACAPI_Element_ChangeDefaults (&element, &memo, &mask); //err = ACAPI_Element_Change (&element, &mask, &memo, ); // SAVE ??????? unplaced library item parameters, not default tools } ACAPI_DisposeAddParHdl (&getParams.params); return; }//ModifyLibParameters (void)
2018-10-05 02:08 PM
2018-10-05 04:41 PM
2018-10-05 05:07 PM
2018-10-05 06:52 PM
2018-10-09 01:34 PM
ufo_ru wrote:So, then is it a library global that appears in the model view options?
From the API, you need to change the parameters of the biliotech element, this element will not be placed on the plan, and will not be the element of the tool by default.
http://archicadapi.graphisoft.com/documentation/api_paramovnertype
Library part default - so I get it, then change it, but I don’t know how to save
Then through the GDL, LIBRARYGLOBAL ("Get_Global", "Global_kSum", kSum) in the desired element.
2018-10-09 02:48 PM
2018-10-19 01:46 PM
Ralph wrote:
Sorry, I'm still confused about what you want to achieve. Can you describe the intended workflow?