Opens a new project file.
GSErrCode ACAPI_Automate ( APIDo_OpenID, API_FileOpenPars* fileOpenPars );
- [in] Parameters for opening a project file.
- The function has completed with success.
openPars->fileis not a valid location, or
openPars->fileTypeIDis unknown file type
For other common API errors see the API Errors document.
This function is used to open an existing project file.
It cannot be called from notification level; the command is refused if other addons are running. Calling this function may notify other addons on the event. The caller addon does not get any notification. See the Notification Manager for further details.
This function performs complete operations, so it cannot be called neither during undoable operations nor during non-undoable commands. See more details on this topic at Command Overview.
API_FileOpenPars openPars; BNZeroMemory (&openPars, sizeof (API_FileOpenPars)); openPars.fileTypeID = APIFType_PlanFile; openPars.useStoredLib = true; IO::Location folderLoc; API_SpecFolderID specID = API_ApplicationFolderID; ACAPI_Environment (APIEnv_GetSpecFolderID, &specID, &folderLoc); folderLoc.AppendToLocal ("ARCHICAD Examples"); folderLoc.AppendToLocal ("Residential House"); openPars.file = new IO::Location (folderLoc, "Residential House.pla"); GSErrCode err = ACAPI_Automate (APIDo_OpenID, &openPars, nullptr); if (err != NoError) ACAPI_WriteReport ("Cannot open the file", true); delete openPars.file;
- Version: API 2.1 or later
- Header: APIdefs_Automate.h