We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2023-06-01 02:51 PM
Is it possible to suspend groups in Element Observers / ElementEventHandlerProc?
When I try to use ACAPI_Element_Tool with APITool_SuspendGroups I get APIERR_REFUSEDCMD
.
I use it like this:
err = ACAPI_Element_Tool ({}, APITool_SuspendGroups, nullptr);
Other values in the first parameter give the same error.
I've also tried ungrouping and after the operation grouping an element to achieve a similar effect, but the group/ungroup command needs an undo scope.
Both approaches work for me outside of an event handler.
Are there any other workarounds or am I using one of the commands wrong in the EventHandler context?
Solved! Go to Solution.
2023-09-15 08:46 AM
I got an answer from Support a while ago about this and I just remembered to share it here as well.
To summarize:
They also think it's weird too, that the suspending groups doesn't work in the case of changing the zone polygon.
They will look into it but can't promise anything right now since they have a lot of other developments going on.
2023-06-02 11:43 AM
Why do you need to ungroup elements? Perhaps it is enough to exclude the processing of groups?
if (elemType->elemHead.typeID == API_GroupID) return NoError;
Structural engineer, developer of free addon for sync GDL param and properties
2023-06-02 12:36 PM
That won't work unfortunately. I want to change an element with ACAPI_Element_Change but this requires the Element to not be in a group or suspend groups to be off (see APIERR_BADPARS in the link).
2023-06-28 03:44 PM
I’ve figured out that this actually isn’t the case for all events!
These are the cases I've found:
Action |
API_ElementDBEventID |
Suspend Groups Works |
---|---|---|
Change Zone Polygon |
APINotifyElement_Edit |
False |
Move Zone |
APINotifyElement_Edit |
True |
Change Zone Parameter |
APINotifyElement_Change |
True |
So maybe it’s a bug when changing the zone shape?
I sent a ticket about it to support.
2023-09-15 08:46 AM
I got an answer from Support a while ago about this and I just remembered to share it here as well.
To summarize:
They also think it's weird too, that the suspending groups doesn't work in the case of changing the zone polygon.
They will look into it but can't promise anything right now since they have a lot of other developments going on.