BIM Coordinator Program (INT) April 22, 2024
Find the next step in your career as a Graphisoft Certified BIM Coordinator!
Archicad C++ API
About Archicad add-on development using the C++ API.

Create New Project using ACAPI_ProjectOperation_NewProject

kency
Booster

Hello all, 

 

I was trying to create a new project when the add-on gets triggered and I saw the function 

ACAPI_ProjectOperation_NewProject which opens a new project. But I would like to also save the existing project before opening a new project. I tried the below code:

 

 

GSErrCode CreateNewProject() {
    API_NewProjectPars    npp = {};
    npp.newAndReset = true;
    npp.enableSaveAlert = true;
    GSErrCode err = ACAPI_ProjectOperation_NewProject (&npp);
    return err;
}

 

 

In spite of having the enableSaveAlert to true, it did not give me any alert. Also, I had tried the

ACAPI_ProjectOperation_Save() function as well. But this also did not Save anything.

 

Is my expectation right for these functions/params? Or is there any other way through which we can do a Save of the existing project and post that open a new project?

 

Notes

Tried on MacOS(Intel)

Archicad 27 and on 25 with the ACAPI_Automate()

2 REPLIES 2
Viktor Kovacs
Graphisoft
Graphisoft

Please make sure you are not using the DEMO version of Archicad. The DEMO version can't save files.

Yes, @Viktor Kovacs tried on the licensed version of Archicad. Missed out on mentioning the same.

Learn and get certified!