cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
Archicad C++ API
About Archicad add-on development using the C++ API.

Any workaround for the removed SetActParameters API in Archicad 28/29?

Steve Sunny
Participant

Hi all,

I have a custom GDL library object that builds dropdown options dynamically using the PARAMETER script (via VALUES).

In older Archicad versions, it was possible to “commit” evaluated parameters to tool defaults (e.g., with SetActParameters / APIAny_SetActParametersID), so when opening Object Tool Settings (defaults) the dropdown would already be populated.

In Archicad 28/29 that API no longer exists, and since PARAMETER doesn’t run in defaults, the dropdown only shows “TBA” until an actual element is placed or the script runs some other way.

Static popup lists still work fine — but dynamic dropdowns in my custom object do not.

👉 Is there any new API or known workaround to trigger or commit PARAMETER evaluation to defaults in 28/29 without placing an element first?

3 REPLIES 3

Hi Steve,

 

I couldn't find any references to 'SetActParameters' also in older DevKits. I checked DevKit 6.1 and for versions AC22, AC24 and AC27. Which AC versions are you talking about?

If you want to change tool defaults, you'd need depending on your AC version:

  • <= AC26: APIAny_OpenParametersID, APIAny_GetActParametersID, APIAny_ChangeAParameterID, APIAny_CloseParametersID 
  • >= AC27: ACAPI_LibraryPart_OpenParameters, ACAPI_LibraryPart_GetActParameters, ACAPI_LibraryPart_ChangeAParameterID, ACAPI_LibraryPart_CloseParameters

And then use ACAPI_Element_ChangeDefaults. I think running the "ChangeAParameter" functions also runs the parameter script and should populate the dynamic dropdowns, but I'm not 100% sure, so you'll have to try. For more details check the documentation on the ACAPI_LibraryPart_ChangeAParameterID function.

 

Hope that helps,

Bernd

Automating Archicad with Add-Ons, GDL-Objects & Python Archi-XT.com

@Steve Sunny wrote:

Is there any new API or known workaround to trigger or commit PARAMETER evaluation to defaults in 28/29 without placing an element first?


You could try using ACAPI_LibraryManagement_RunGDLParScript

This runs the object parameter script.

Ralph Wessel BArch
Central Innovation
Akos Somorjai
Graphisoft
Graphisoft

That function has a non-optional element header parameter, so it only works for placed objects, not element defaults.