2023-06-12 10:42 AM - last edited on 2023-06-12 01:57 PM by Barry Kelly
Hi,
I'm just getting started with Archicad API development.
I want to change the GSHandle array parameter in a value of a GDL object.
I have already used code like (*memo.params)[param_index].value.real = 5 to change the numerical parameters
and used code like
GS::UniString teststr = Object_Name;
GS::ucscpy((*memo.params)[param_index].value.uStr, teststr.ToUStr());
to change the string parameters.
Now, I want to change the selection parameter. For example, for this parameter, this object has two choice "yes" and "no", I want to change it to "yes", how can I do this?
Thank you very much!
2023-06-16 04:22 PM
Hi,
Often such choices parameters are implemented in GDL via two different arrays.
One for the textual descriptions of the options and one with numerical representations (think enums in C++).
Do you have access to the GDL code of the object? If you find the VALUES{2} keyword for the selection parameters, then this would suggest that the choice is implemented as I've described.
So my approach would be to change the underlying numerical representation and then to make sure that the parameter script is run.
I didn't need it for a while so I'm not sure about the details but I think APIAny_OpenParametersID and the related functions would take care of that.
Hope that helps,
Bernd
2023-06-17 12:33 PM
Thank you very much!
This is excactly what I did, go to the GDL code and find the selection parameter and then change it the same way as the numerical parameters.
Thank you again!