We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2022-09-30 08:33 AM
When using walls, colums etc in AC the tool stays active after you finish your input.
Is it possible to get this behaviour for an addon?
I have a palette with an icon that let me place a text element, but i have to reclick the icon for each new text element.
Is there a way to make this comand 'sticky' so i can reuse it multiple time ?
Solved! Go to Solution.
2022-10-03 01:57 PM
Thanks for the clarification. I misunderstood your question.
If I understand it correctly now, I think you would have to manage that manually by e.g. having a loop in your ButtonClicked event observer and stop the loop once the user cancels the input. For example the function APIIo_GetPointID returns APIERR_CANCEL when users cancel the input.
Does this address your issue? Otherwise could you provide the code of your ButtonClicked event observer?
2022-10-01 10:37 AM
Hi!
Are you using an `IconButton`?
I think the behavior you want should work with an `IconPushCheck`.
2022-10-03 07:27 AM
I do use an iconButton on my palette, yes.
The issue is not to retain some parameter that works just fine, the issue is that I want the command linked to that button to stay active once the first iteration is finished.
In the palette I have a buttonclicked event observer, what I want it the function lnked to the button to be called again once it completes.
2022-10-03 01:57 PM
Thanks for the clarification. I misunderstood your question.
If I understand it correctly now, I think you would have to manage that manually by e.g. having a loop in your ButtonClicked event observer and stop the loop once the user cancels the input. For example the function APIIo_GetPointID returns APIERR_CANCEL when users cancel the input.
Does this address your issue? Otherwise could you provide the code of your ButtonClicked event observer?
2022-10-03 02:35 PM - edited 2022-10-03 02:38 PM
Sorry I forgot to come back to say I found the solution.
Like you suggested i changed my function return type to GSErrCode and wrapped it in a do-while loop.
GSErrCode Do_iterate() {
GSErrCode err;
do {
ACAPI_CallUndoableCommand("Iterated element",
[&]() -> GSErrCode {
err = Do_CreateText();
return NoError;
});
} while (err == NoError);
return err;
}
my Do_CreateText function calls ClickAPoint() from APICommon.c whick does return APIERR_Cancel
Thanks for the help.