We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

Archicad C++ API
About Archicad add-on development using the C++ API.

APIDo_SaveID - saving to .xls from schedule

Anonymous
Not applicable
Hello
I am trying to save a interactive schedule as a .xls file using APIDo_SaveID function.
I have been able to open the interactive schedule view and now I want to be able to do a save as.

There is no excel fileTypeID to apply to the API_FileSavePars.fileTypeID structure

//code------
//save file as excel
API_FileSavePars savePara;
std::string newXcelFilename = "exportExcelTest.xls";

BNZeroMemory(&savePara, sizeof(API_FileSavePars));
savePara.fileTypeID = APIFType_TabListFile;

IO::Location folderLoc;
API_SpecFolderID specID = API_UserDocumentsFolderID;
ACAPI_Environment(APIEnv_GetSpecFolderID, &specID, &folderLoc);
savePara.file = new IO::Location(folderLoc, IO::Name(newXcelFilename.c_str()));

err = ACAPI_Automate(APIDo_SaveID, &savePara, nullptr);

I hope someone can help ...please !

Archicad 22
Dev Kit 22.3004
Windows 8
2 REPLIES 2
leilei
Enthusiast
Hi
Maybe you can look at the Do_ExportWallsToExcel function in Database_Control test .
Tibor Lorantfy
Graphisoft Alumni
Graphisoft Alumni
Using ACAPI_Automate(APIDo_SaveID,...) the content of the current window cannot be saved to Excel file.
As leilie said, you can find an example in Database_Control Example Add-On for writing Excel files. In that way you can write any data into the Excel file, but you have to collect those informations first.