We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

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

Unable to change parameter "B"

Anonymous
Not applicable
CHCopyC ("B",chgParam.name); 
			 chgParam.realValue = Value; 
			 err = ACAPI_Goodies (APIAny_ChangeAParameterID, &chgParam, NULL); 
		

I change parameter "B" value and after using function:
err = ACAPI_LibPart_GetParams (LibIndex, &aa, &bb, &addParNum, &getParams.params) ; 
 

"B" value turns back to "default" as it was before. How could i fix this so calling "B" (with ACAPI_LibPart_GetParams) returns changed value ?
Other parameters works fine have just problem with "A" and "B" after using ACAPI_LibPart_GetParams.
5 REPLIES 5
Anonymous
Not applicable
ACAPI_ELEMENT_MASK_SET (mask, API_ObjectType, yRatio); 
	memo.params = getParams.params;

Maybe there is an issue with mask? By using mask differently could i get changed "B" after using ACAPI_LibPart_GetParams ?
Anonymous
Not applicable
Now i ran parameter change function again after ACAPI_LibPart_GetParams, it seams that parameter have changed, but when creating object it creates object without changed "B" parameter although API shows "B" is changed value.

I'm surely missing something. Parameter update or something..
Anonymous
Not applicable
Soooo...
I didn't solve my issue, but!
By using elem.object.xRatio = valueX;
elem.object.yRatio = valueY;
I did find workaround to get desired A and B positions. No idea why i couldn't change A and B.
Ralph Wessel
Mentor
Rinovo wrote:
Soooo...
I didn't solve my issue, but!
By using elem.object.xRatio = valueX;
elem.object.yRatio = valueY;
I did find workaround to get desired A and B positions. No idea why i couldn't change A and B.
The axial geometry of library parts is a bit messy in the API. If we're setting trying to set the axial width (for example) we set both the 'B' parameter and the xRatio field, but it's the latter that matters. Also take note of the useXYFixSize field – when false, the width is calculated as xRatio multiplied by the default library part 'B' parameter value.
Ralph Wessel BArch
Software Engineer Speckle Systems
Anonymous
Not applicable
Thanks Ralph, for pointing out useXYFixSize.

Now i see why xRatio didn't multiply, i was already wondering why didn't it multiply.
My first though was to use xRatio multiplier to calculate desired 'B' width. Turned out i can just set xRatio as desired width value.