2012-09-07 08:35 AM - last edited on 2023-08-02 05:01 PM by Doreena Deng
Solved! Go to Solution.
2019-11-04 01:37 PM
n.mihaylov wrote:Fsp.file should have the file name in it. Make sure the path you put into fsp.file has it (for example: c:\temp\file.pln is a good path)
I have problems saving to a solo project. There's no error when I save using the example in Automate_Functions example. But when I try to add file destination I get APIERR_GENERAL:
API_FileSavePars fsp; API_SavePars_PlanDump pars; GSErrCode err; BNZeroMemory (&fsp, sizeof (API_FileSavePars)); IO::Location folderLoc; API_SpecFolderID specID = API_UserDocumentsFolderID; ACAPI_Environment (APIEnv_GetSpecFolderID, &specID, &folderLoc); fsp.file = new IO::Location (folderLoc); fsp.fileTypeID = APIFType_PlanFile; BNZeroMemory (&pars, sizeof (API_SavePars_PlanDump)); err = ACAPI_Automate (APIDo_SaveID, &fsp, &pars);Can someone help me?
P.S. I also havе troubles with IO::Location::AppendToLocal - what type of argument does it take so I can add the filename to the path?
2012-09-07 10:29 AM
GDefina wrote:Because the file is constructed from a template, it isn't associated with any existing file (the link with the template file is severed to prevent users from saving over it). If you want to save to a file with a specific name/location, you need to fill in the
err = ACAPI_Automate(APIDo_SaveID, NULL, NULL, NULL);
from my menu handler with a new plan open from a template and it returns NoError but the file is not saved.
2012-09-08 02:27 AM
2012-09-08 12:12 PM
GDefina wrote:I'm assuming you want to save the project as an ArchiCAD solo project file, in which case you would use
How can I determine the FileTypeId of the current file?
It's not part of ProjectInfo. Or can I use APIFType_None?
2012-09-08 12:27 PM
2019-11-04 10:23 AM
API_FileSavePars fsp; API_SavePars_PlanDump pars; GSErrCode err; BNZeroMemory (&fsp, sizeof (API_FileSavePars)); IO::Location folderLoc; API_SpecFolderID specID = API_UserDocumentsFolderID; ACAPI_Environment (APIEnv_GetSpecFolderID, &specID, &folderLoc); fsp.file = new IO::Location (folderLoc); fsp.fileTypeID = APIFType_PlanFile; BNZeroMemory (&pars, sizeof (API_SavePars_PlanDump)); err = ACAPI_Automate (APIDo_SaveID, &fsp, &pars);Can someone help me?
2019-11-04 01:37 PM
n.mihaylov wrote:Fsp.file should have the file name in it. Make sure the path you put into fsp.file has it (for example: c:\temp\file.pln is a good path)
I have problems saving to a solo project. There's no error when I save using the example in Automate_Functions example. But when I try to add file destination I get APIERR_GENERAL:
API_FileSavePars fsp; API_SavePars_PlanDump pars; GSErrCode err; BNZeroMemory (&fsp, sizeof (API_FileSavePars)); IO::Location folderLoc; API_SpecFolderID specID = API_UserDocumentsFolderID; ACAPI_Environment (APIEnv_GetSpecFolderID, &specID, &folderLoc); fsp.file = new IO::Location (folderLoc); fsp.fileTypeID = APIFType_PlanFile; BNZeroMemory (&pars, sizeof (API_SavePars_PlanDump)); err = ACAPI_Automate (APIDo_SaveID, &fsp, &pars);Can someone help me?
P.S. I also havе troubles with IO::Location::AppendToLocal - what type of argument does it take so I can add the filename to the path?
2019-11-04 01:58 PM