Developer forum
cancel
Showing results for 
Search instead for 
Did you mean: 

How to call ACAPI_Automate(APIDo_SaveID) inside ACAPI_CallUndoableCommand scope?

n_mihaylov
Newcomer
Hello guys,

I call a function in ACAPI_CallUndoableCommand scope and inside this function I call ACAPI_Automate(APIDo_SaveID) and ACAPI_Automate is not working:

ACAPI_CallUndoableCommand("Import Files", [&]() -> GSErrCode { ImportFiles(); return (0); });

void ImportFiles()
{
        ...
        ACAPI_Automate(APIDo_SaveID);
}
Is there a way to get out of this scope or I have to call it outside ImportFiles?
1 ACCEPTED SOLUTION

Solution
Tibor Lorantfy
Graphisoft
Graphisoft
Hi,

APIDo_SaveID is not allowed to be called inside ACAPI_CallUndoableCommand scope.
Sorry, you have to call it outside.

Regards,
Tibor

View solution in original post

3 REPLIES 3

Solution
Tibor Lorantfy
Graphisoft
Graphisoft
Hi,

APIDo_SaveID is not allowed to be called inside ACAPI_CallUndoableCommand scope.
Sorry, you have to call it outside.

Regards,
Tibor

View solution in original post

n_mihaylov
Newcomer
In order not to open a new topic for these automated functions, how can I open a new project with the "rectangle area" in the center? I open a new project using the example and don't have it:

        API_NewProjectPars npp;

	BNZeroMemory(&npp, sizeof(API_NewProjectPars));
	npp.newAndReset = true;
	npp.enableSaveAlert = false;

	GSErrCode err = ACAPI_Automate(APIDo_NewProjectID, &npp);
	
If I manually open a new project, ARCHICAD 23 Template.tpl is choosen and everything is OK.

How can I choose this template with the automated function?

MOREH Tamas
Newcomer
Hi!
You are right it is currently not possible.
I register it in our issue tracking database and we will implement as soon as we can.
Thank you for the report.

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!