2021-10-13 06:01 PM - last edited on 2024-09-24 09:44 AM by Doreena Deng
Hello,
I'm working on an add-on for AC24.
The base of our add-on is the Browser_Control example.
We are selecting an element in the model and we are importing properties information for the selected element.
We cannot create a new Property Group like its done with Property_Test.
API_PropertyGroup group;
group.guid = APINULLGuid;
group.name = "PROPERTY GROUP NAME" + guid.ToUniString();
ACAPI_Property_CreatePropertyGroup(group);
is not working.
Moreover, we would like to set property definition default value to Undefined:
definition.defaultValue.basicValue.variantStatus = API_VariantStatusUserUndefined;
is not working.
Thank you for your help.
2021-10-15 01:22 PM
Please make sure that you are calling ACAPI_Property_CreatePropertyGroup in an undoable command scope (ACAPI_CallUndoableCommand).
More information here (check the Undo Scope) section:
https://archicadapi.graphisoft.com/Archicad-maze-generator-add-on-tutorial-part-1
2021-10-15 03:18 PM
Thank you for your answer.
Well I think so. Please find below our code:
2021-10-15 03:42 PM
This function only shows the palette, it doesn't do any modification in the database. After the palette is opened, the undo scope closes.
You have to wrap the code with ACAPI_CallUndoableCommand where the real modification happens.
2021-10-18 06:09 PM - last edited on 2021-10-19 12:53 AM by Laszlo Nagy
Thank you for your answer.
Sorry, I am quite new in Cpp and Archicad API. Like said before, our Add On is based on the Browser_Control.
We use it in order to add data from a web server.
All of our code is in the function BrowserPalette::RegisterACAPIJavaScriptObject. We try to wrap it with ACAPI_CallUndoableCommand however without success.
2021-10-22 11:32 AM
Hello Viktor,
Sorry to insist, but we still cannot succeed in wrapping the BrowserPalette::RegisterACAPIJavascriptObject() or any JSFunction inside ACAPI_CallUndoableCommand in the case of the Browser_Control example.
Any idea?
Thank you for your assistance.
2021-10-22 11:34 AM
Could you please attach the wrapping code?