The Global ARCHICAD Community

Stay informed. Get help. Share your knowledge.

Discussions about using GRAPHISOFT's tools (API DevKit) for independent software developers

Moderators: Karl Ottenstein, LaszloNagy, ejrolon, Barry Kelly, gkmethy, rmasaki, MOREH Tamas, Akos Somorjai, Ed Brown, Mihály Palenik, Tibor Lorántfy

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:
Code: Select all
ACAPI_CallUndoableCommand("Import Files", [&]() -> GSErrCode { ImportFiles(); return (0); });

void ImportFiles()
Is there a way to get out of this scope or I have to call it outside ImportFiles?
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:
Code: Select all
        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?