Archicad 27 C++ API
Loading...
Searching...
No Matches
Project Operations

Functions related the the server application and various project-related events, such as saving or publishing the project. More...

Classes

struct  API_NewProjectPars
 Parameters to open a new project. More...
 
struct  API_FileOpenPars
 Parameters to open a new project file. More...
 
struct  API_SavePars_Archive
 Parameters to save the current project as archive file. More...
 
struct  API_SavePars_PlanDump
 Contains the different options for saving a plan dump from Archicad. More...
 
struct  API_SavePars_Object
 Contains the different options for saving an Archicad object, lamp, door, or window. More...
 
struct  API_SavePars_Picture
 Contains the different options for saving pictures from Archicad. More...
 
struct  API_IFCTranslatorIdentifier
 IFC Translator Identifier. More...
 
struct  API_SavePars_Ifc
 Parameters to save the current project as an Ifc file. More...
 
struct  API_SavePars_Pdf
 Contains the different page options for saving to pdf file. More...
 
struct  API_SavePars_Saf
 Contains the export filter type for the SAF file. More...
 
struct  API_FileSavePars
 Parameters to save the current project file. More...
 
struct  API_PrintStampType
 Printing header/footer parameters. More...
 
struct  API_PrintPars
 Printing parameters. More...
 
struct  API_PublishPars
 Publishing parameters. More...
 
struct  API_ProjectInfo
 Contains information about the current project. More...
 
struct  API_UserInfo
 Information on a registered Team Member. More...
 
struct  API_SharingInfo
 Project sharing parameters. More...
 
struct  API_MiscAppInfo
 Miscellaneous information of the application. More...
 
struct  API_MiscPrinterInfo
 Miscellaneous information of the selected printer. More...
 
struct  API_MiscPlotterInfo
 Miscellaneous information of the selected plotter. More...
 

Typedefs

typedef GSErrCode __ACENV_CALL APIProjectEventHandlerProc(API_NotifyEventID notifID, Int32 param)
 Callback function to receive notifications on changes of the project.
 

Enumerations

enum  API_FTypeID {
  APIFType_None , APIFType_PlanFile , APIFType_A_PlanFile , APIFType_Bak_PlanFile ,
  APIFType_PlanFile600 , APIFType_A_PlanFile600 , APIFType_PlanFile650 , APIFType_A_PlanFile650 ,
  APIFType_PlanFile700 , APIFType_A_PlanFile700 , APIFType_TabListFile , APIFType_ObjectFile ,
  APIFType_DoorFile , APIFType_WindowFile , APIFType_GDLFile , APIFType_2DLinesFile ,
  APIFType_PNGFile , APIFType_BMPFile , APIFType_TIFFFile , APIFType_JPEGFile ,
  APIFType_GIFFile , APIFType_EMFFile , APIFType_WMFFile , APIFType_PlanFile800 ,
  APIFType_A_PlanFile800 , APIFType_PlanFile810 , APIFType_A_PlanFile810 , APIFType_PlanFile900 ,
  APIFType_A_PlanFile900 , APIFType_PlanFile1000 , APIFType_A_PlanFile1000 , APIFType_PlanFile1100 ,
  APIFType_A_PlanFile1100 , APIFType_PlanFile1200 , APIFType_A_PlanFile1200 , APIFType_IfcFile ,
  APIFType_PlanFile1300 , APIFType_A_PlanFile1300 , APIFType_PlanFile1400 , APIFType_A_PlanFile1400 ,
  APIFType_PlanFile1500 , APIFType_A_PlanFile1500 , APIFType_PlanFile1600 , APIFType_A_PlanFile1600 ,
  APIFType_PlanFile1700 , APIFType_A_PlanFile1700 , APIFType_PlanFile1800 , APIFType_A_PlanFile1800 ,
  APIFType_PdfFile , APIFType_PlanFile1900 , APIFType_A_PlanFile1900 , APIFType_PlanFile2000 ,
  APIFType_A_PlanFile2000 , APIFType_PlanFile2100 , APIFType_A_PlanFile2100 , APIFType_PlanFile2200 ,
  APIFType_A_PlanFile2200 , APIFType_PlanFile2300 , APIFType_A_PlanFile2300 , APIFType_PlanFile2400 ,
  APIFType_A_PlanFile2400 , APIFType_PlanFile2500 , APIFType_A_PlanFile2500 , APIFType_PlanFile2600 ,
  APIFType_A_PlanFile2600 , APIFType_SafFile
}
 Available file format identifiers for automated functions. More...
 
enum  API_ConvModID {
  APIConvMod_TextGDL , APIConvMod_MemGDL , APIConvMod_SymTxtGDL , APIConvMod_SymBinGDL ,
  APIConvMod_SideGDL , APIConvMod_DragGDL
}
 Represents the type of the Archicad object to be saved. More...
 
enum  API_IfcTypeID { API_IFC , API_IFCZIP }
 Defines type of file format for IFC Export. More...
 
enum  API_ElementsToIfcExportID {
  API_EntireProject = 1 , API_VisibleElementsOnAllStories , API_AllElementsOnCurrentStorey , API_VisibleElementsOnCurrentStorey ,
  API_SelectedElementsOnly , API_FilteredElements
}
 Selected elements for IFC export. More...
 
enum  API_ElementsToSAFExportID { API_SAFSelectedElementsOnly = 1 , API_SAFEntireProject , API_SAFVisibleElements }
 Selected elements for SAF export. More...
 
enum  API_NotifyEventID {
  APINotify_New = 0x00000001 , APINotify_NewAndReset = 0x00000002 , APINotify_Open = 0x00000004 , APINotify_PreSave = 0x00000008 ,
  APINotify_Save = 0x00000010 , APINotify_Close = 0x00000020 , APINotify_Quit = 0x00000040 , APINotify_TempSave = 0x00000080 ,
  APINotify_SendChanges = 0x00008000 , APINotify_ReceiveChanges = 0x00010000 , APINotify_ChangeProjectDB = 0x00040000 , APINotify_ChangeWindow = 0x00080000 ,
  APINotify_ChangeFloor = 0x00100000 , APINotify_ChangeLibrary = 0x00200000 , APINotify_AllInputFinished = 0x00400000 , APINotify_UnitChanged = 0x00800000 ,
  APINotify_SideviewCreated = 0x01000000 , APINotify_SideviewRebuilt = 0x02000000 , APINotify_PropertyVisibilityChanged = 0x04000000 , APINotify_ClassificationVisibilityChanged = 0x08000000 ,
  APINotify_ShowIn3DChanged = 0x10000000
}
 Possible values for notifications on project events. More...
 
enum  API_NotifyViewEventID {
  APINotifyView_Inserted = 0x00000001 , APINotifyView_Modified = 0x00000002 , APINotifyView_Deleted = 0x00000004 , APINotifyView_Opened = 0x00000008 ,
  APINotifyView_Begin = 0x00000010 , APINotifyView_End = 0x00000020
}
 Possible values for notifications on Project Navigator events. More...
 

Functions

GSErrCode __ACENV_CALL ACAPI_ProjectOperation_NewProject (const API_NewProjectPars *newProjectPars)
 Opens a new plan.
 
GSErrCode __ACENV_CALL ACAPI_ProjectOperation_Open (const API_FileOpenPars *fileOpenPars)
 Opens a new project file.
 
GSErrCode __ACENV_CALL ACAPI_ProjectOperation_Close (const Int32 magicCode=0)
 Closes the current project window.
 
GSErrCode __ACENV_CALL ACAPI_ProjectOperation_Save ()
 Saves the content of the current window in different file formats.
 
GSErrCode __ACENV_CALL ACAPI_ProjectOperation_Save (const API_FileSavePars *fileSavePars)
 Saves the content of the current window in different file formats.
 
GSErrCode __ACENV_CALL ACAPI_ProjectOperation_Save (const API_FileSavePars *fileSavePars, const API_SavePars_Archive *formatPars)
 Saves the content of the current window in different file formats.
 
GSErrCode __ACENV_CALL ACAPI_ProjectOperation_Save (const API_FileSavePars *fileSavePars, const API_SavePars_PlanDump *formatPars)
 Saves the content of the current window in different file formats.
 
GSErrCode __ACENV_CALL ACAPI_ProjectOperation_Save (const API_FileSavePars *fileSavePars, const API_SavePars_Object *formatPars)
 Saves the content of the current window in different file formats.
 
GSErrCode __ACENV_CALL ACAPI_ProjectOperation_Save (const API_FileSavePars *fileSavePars, const API_SavePars_Picture *formatPars)
 Saves the content of the current window in different file formats.
 
GSErrCode __ACENV_CALL ACAPI_ProjectOperation_Save (const API_FileSavePars *fileSavePars, const API_SavePars_Ifc *formatPars, API_IFCRelationshipData *resultData=nullptr)
 Saves the content of the current window in different file formats.
 
GSErrCode __ACENV_CALL ACAPI_ProjectOperation_Save (const API_FileSavePars *fileSavePars, const API_SavePars_Pdf *formatPars)
 Saves the content of the current window in different file formats.
 
GSErrCode __ACENV_CALL ACAPI_ProjectOperation_Save (const API_FileSavePars *fileSavePars, const API_SavePars_Saf *formatPars)
 Saves the content of the current window in different file formats.
 
GSErrCode __ACENV_CALL ACAPI_ProjectOperation_ReloadLibraries ()
 Resets and loads the active libraries.
 
GSErrCode __ACENV_CALL ACAPI_ProjectOperation_Print (const API_PrintPars *printPars=nullptr)
 Prints the content of the current window.
 
GSErrCode __ACENV_CALL ACAPI_ProjectOperation_Quit (Int32 magicCode)
 Terminates the server application.
 
GSErrCode __ACENV_CALL ACAPI_ProjectOperation_SaveAsModuleFile (const IO::Location *location, GS::Array< API_Elem_Head > *elemHead=nullptr)
 Saves the selected elements into a module file.
 
GSErrCode __ACENV_CALL ACAPI_ProjectOperation_Publish (const API_PublishPars *publishPars, const GS::Array< API_Guid > *selectedLinks=nullptr)
 Publishes a publisher set.
 
GSErrCode __ACENV_CALL ACAPI_ProjectOperation_Project (API_ProjectInfo *projectInfo)
 Returns information on the current project file.
 
GSErrCode __ACENV_CALL ACAPI_Teamwork_ProjectSharing (API_SharingInfo *sharingInfo)
 Returns the project sharing data in the case of a TeamWork project.
 
GSErrCode __ACENV_CALL ACAPI_ProjectOperation_GetMiscAppInfo (API_MiscAppInfo *miscAppInfo)
 Gets miscellaneous information about application.
 
GSErrCode __ACENV_CALL ACAPI_ProjectOperation_GetMiscPrinterInfo (API_MiscPrinterInfo *miscPrinterInfo)
 Gets miscellaneous information about current printer.
 
GSErrCode __ACENV_CALL ACAPI_ProjectOperation_GetMiscPlotterInfo (API_MiscPlotterInfo *miscPlotterInfo)
 Gets miscellaneous information about plotter.
 
GSErrCode __ACENV_CALL ACAPI_ProjectOperation_GetPrinterPars (API_PrintPars *printPars)
 Retrieves the current printer settings.
 
GSErrCode __ACENV_CALL ACAPI_ProjectOperation_AdditionalFileWasCreated (const IO::Location &path)
 Informs Archicad about the additionally created file during exporting or publishing. Required for handling them with the target file. (E.g. uploading to BIMcloud together.)
 
GSErrCode __ACENV_CALL ACAPI_ProjectOperation_CatchProjectEvent (GSFlags eventTypes, APIProjectEventHandlerProc *handlerProc)
 Register or unregister your add-on to be notified of application and project events.
 

Detailed Description

Functions related the the server application and various project-related events, such as saving or publishing the project.

Typedef Documentation

◆ APIProjectEventHandlerProc

typedef GSErrCode __ACENV_CALL APIProjectEventHandlerProc(API_NotifyEventID notifID, Int32 param)

Callback function to receive notifications on changes of the project.

Parameters
notifID[in] The type of the project event the notification is for.
param[in] This parameter is valid only if the notifID is APINotify_ChangeLibrary. If an individual library part has changed in the library (e.g. it was added to the library), then this parameter contains the index of that library part. This parameter is also valid if notifID is APINotify_ChangeProjectDB, and contains a code for the cause of the event.
param Event cause
0 Other
1 Floor(s) edited
2 Merge
Returns
  • NoError - The function has completed with success.
Remarks
This is the function which will be called when your add-on requested notifications on project events with ACAPI_ProjectOperation_CatchProjectEvent.

Enumeration Type Documentation

◆ API_ConvModID

Represents the type of the Archicad object to be saved.

Remarks
These options correspond to the formats you can choose while saving something as an Archicad object, both from the plan and the 3D window.

◆ API_ElementsToIfcExportID

Selected elements for IFC export.

Remarks
This type specifies in API_SavePars_Ifc.

◆ API_ElementsToSAFExportID

Selected elements for SAF export.

Since
Archicad 25
Remarks
This type specifies in API_SavePars_Saf.

◆ API_FTypeID

Available file format identifiers for automated functions.

Since
Archicad 25
Remarks
For the utilization of this structure see the ACAPI_ProjectOperation_Open and ACAPI_ProjectOperation_Save automation functions.

◆ API_IfcTypeID

Defines type of file format for IFC Export.

Since
Archicad 26
Remarks
This structure is used only by API_SavePars_Ifc.

◆ API_NotifyEventID

Possible values for notifications on project events.

Since
Archicad 26
Remarks
Refer to ACAPI_ProjectOperation_CatchProjectEvent function for further details.

◆ API_NotifyViewEventID

Possible values for notifications on Project Navigator events.

Remarks
Refer to ACAPI_Notification_CatchViewEvent function for further details.

Function Documentation

◆ ACAPI_ProjectOperation_AdditionalFileWasCreated()

GSErrCode __ACENV_CALL ACAPI_ProjectOperation_AdditionalFileWasCreated ( const IO::Location &  path)

Informs Archicad about the additionally created file during exporting or publishing. Required for handling them with the target file. (E.g. uploading to BIMcloud together.)

Parameters
path[in] The path to the created file.
Returns
  • NoError - The function has completed with success.

◆ ACAPI_ProjectOperation_CatchProjectEvent()

GSErrCode __ACENV_CALL ACAPI_ProjectOperation_CatchProjectEvent ( GSFlags  eventTypes,
APIProjectEventHandlerProc handlerProc 
)

Register or unregister your add-on to be notified of application and project events.

Parameters
eventTypes[in] A combination of different API_NotifyEventID values, specifying the types of project events you are interested in.
handlerProc[in] The callback procedure to call when notifications are sent out on different project events. Specifying nullptr here means you don't need the notifications any more.
Returns
  • NoError - The requested operation finished successfully.
Remarks
This function enables the API tool add-on catch events happening to the project. Each time when such an event occurs the server application calls the supplied handlerProc of your those add-ons which have been registered for this event previously. If you do not need to catch the project events any longer, please remember to unregister by calling ACAPI_ProjectOperation_CatchProjectEvent for the required element type with nullptr in the handlerProc parameter.
Example
// -----------------------------------------------------------------------------
// Project event handler function
// -----------------------------------------------------------------------------
static GSErrCode __ACENV_CALL NotificationHandler (API_NotifyEventID notifID, Int32 param)
{
char msgStr[256];
switch (notifID) {
case APINotify_New: CHCopyC ("APINotify_New", msgStr); break;
case APINotify_NewAndReset: CHCopyC ("APINotify_NewAndReset", msgStr); break;
case APINotify_Open: CHCopyC ("APINotify_Open", msgStr); break;
case APINotify_PreSave: CHCopyC ("APINotify_PreSave", msgStr); break;
case APINotify_Save: CHCopyC ("APINotify_Save", msgStr); break;
case APINotify_Close: CHCopyC ("APINotify_Close", msgStr); break;
case APINotify_Quit: CHCopyC ("APINotify_Quit", msgStr); break;
case APINotify_SendChanges: CHCopyC ("APINotify_SendChanges", msgStr); break;
case APINotify_ReceiveChanges: CHCopyC ("APINotify_ReceiveChanges", msgStr); break;
case APINotify_ChangeProjectDB: CHCopyC ("APINotify_ChangeProjectDB", msgStr); break;
case APINotify_ChangeWindow: CHCopyC ("APINotify_ChangeWindow", msgStr); break;
case APINotify_ChangeFloor: CHCopyC ("APINotify_ChangeFloor", msgStr); break;
case APINotify_ChangeLibrary: CHCopyC ("APINotify_ChangeLibrary", msgStr); break;
}
ACAPI_WriteReport (msgStr, false);
return NoError;
} // NotificationHandler
// -----------------------------------------------------------------------------
// Called after the Add-On has been loaded into memory
// -----------------------------------------------------------------------------
GSErrCode __ACENV_CALL Initialize (void)
{
// catch changes in project events
GSErrCode err = ACAPI_ProjectOperation_CatchProjectEvent (API_AllProjectNotificationMask, NotificationHandler);
return err;
} // Initialize
GSErrCode __ACDLL_CALL Initialize(void)
The main entry point of the add-on.
void __ACENV_CALL ACAPI_WriteReport(const GS::UniString &format, bool withDial,...)
Writes a report string into the Report Windowot into a custom alert window.
GSErrCode __ACENV_CALL ACAPI_ProjectOperation_CatchProjectEvent(GSFlags eventTypes, APIProjectEventHandlerProc *handlerProc)
Register or unregister your add-on to be notified of application and project events.
API_NotifyEventID
Possible values for notifications on project events.
Definition: APIdefs_Callback.h:243

◆ ACAPI_ProjectOperation_Close()

GSErrCode __ACENV_CALL ACAPI_ProjectOperation_Close ( const Int32  magicCode = 0)

Closes the current project window.

Returns
  • NoError - The function has completed with success.
  • APIERR_REFUSEDCMD - The command is not allowed to call.
  • APIERR_NOPLAN - No open project.
Remarks
This function is used to perform a Close command in the server application. 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. Not for public usage.

◆ ACAPI_ProjectOperation_GetMiscAppInfo()

GSErrCode __ACENV_CALL ACAPI_ProjectOperation_GetMiscAppInfo ( API_MiscAppInfo miscAppInfo)

Gets miscellaneous information about application.

Parameters
miscAppInfo[out] Miscellaneous information of the application
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - miscAppInfo is nullptr.
Remarks
This function is used to get version string of application and caption of application's main window.

◆ ACAPI_ProjectOperation_GetMiscPlotterInfo()

GSErrCode __ACENV_CALL ACAPI_ProjectOperation_GetMiscPlotterInfo ( API_MiscPlotterInfo miscPlotterInfo)

Gets miscellaneous information about plotter.

Parameters
miscPlotterInfo[out] Miscellaneous information of the selected plotter
Returns
  • NoError - The function completed with success.
  • APIERR_BADPARS - miscPlotterInfo is nullptr.
Remarks
This function is used to get name and model of selected plotter in Archicad.
Example
API_MiscPlotterInfo miscPlotterInfo;
GSErrCode err;
BNZeroMemory (&miscPlotterInfo, sizeof (API_MiscPlotterInfo) );
err = ACAPI_Environment (APIEnv_GetMiscPlotterInfoID, &miscPlotterInfo, nullptr);
Miscellaneous information of the selected plotter.
Definition: APIdefs_Environment.h:3589

◆ ACAPI_ProjectOperation_GetMiscPrinterInfo()

GSErrCode __ACENV_CALL ACAPI_ProjectOperation_GetMiscPrinterInfo ( API_MiscPrinterInfo miscPrinterInfo)

Gets miscellaneous information about current printer.

Parameters
miscPrinterInfo[out] Miscellaneous information of the selected printer
Returns
  • NoError - The function completed with success.
  • APIERR_BADPARS - miscPrinterInfo is nullptr.
Remarks
This function is used to get name and orientation of selected printer in Archicad. Supported on Windows only.
Example
API_MiscPrinterInfo miscPrinterInfo;
GSErrCode err;
BNZeroMemory (&miscPrinterInfo, sizeof (API_MiscPrinterInfo) );
err = ACAPI_Environment (APIEnv_GetMiscPrinterInfoID, &miscPrinterInfo, nullptr);
Miscellaneous information of the selected printer.
Definition: APIdefs_Environment.h:3565

◆ ACAPI_ProjectOperation_GetPrinterPars()

GSErrCode __ACENV_CALL ACAPI_ProjectOperation_GetPrinterPars ( API_PrintPars printPars)

Retrieves the current printer settings.

Parameters
printPars[out] the printing parameters
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - The printPars parameter is nullptr
Remarks
This function retrieves the printing settings currently used.
Example
API_PrintPars printPars;
BNZeroMemory (&printPars, sizeof (API_PrintPars));
GSErrCode err = ACAPI_Environment (APIEnv_GetPrinterParsID, &printPars, nullptr);
double pageWidth, pageHeight;
if (err == NoError) {
pageWidth = printPars.right - printPars.left;
pageHeight = printPars.bottom - printPars.top;
} else {
pageWidth = 0.20142199;
pageHeight = 0.28858633;
}
Printing parameters.
Definition: APIdefs_Automate.h:739
double left
Left print margin.
Definition: APIdefs_Automate.h:826
double right
Right print margin.
Definition: APIdefs_Automate.h:836
double top
Top print margin.
Definition: APIdefs_Automate.h:821
double bottom
Bottom print margin.
Definition: APIdefs_Automate.h:831

◆ ACAPI_ProjectOperation_NewProject()

GSErrCode __ACENV_CALL ACAPI_ProjectOperation_NewProject ( const API_NewProjectPars newProjectPars)

Opens a new plan.

Parameters
newProjectPars[in] Parameters for opening a new project.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - newplanPars is nullptr
  • APIERR_REFUSEDCMD - the function is called from notification level
Remarks
This function is used to perform a New or a New and reset command in the server application. 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.
Example
API_NewProjectPars newPlanPars;
BNZeroMemory (&newPlanPars, sizeof (API_NewProjectPars));
newPlanPars.newAndReset = true;
ACAPI_Automate (APIDo_NewProjectID, &newPlanPars, nullptr);
Parameters to open a new project.
Definition: APIdefs_Automate.h:77
bool newAndReset
Performs New and Reset or just a simple New command.
Definition: APIdefs_Automate.h:82

◆ ACAPI_ProjectOperation_Open()

GSErrCode __ACENV_CALL ACAPI_ProjectOperation_Open ( const API_FileOpenPars fileOpenPars)

Opens a new project file.

Parameters
fileOpenPars[in] Parameters for opening a project file.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - openPars or openPars->file is nullptr, or openPars->file is not a valid location, or openPars->archiveLib is nullptr if openPars->libGiven is true
  • APIERR_BADID - openPars->fileTypeID is unknown file type
Remarks
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.
Example
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;
API_SpecFolderID
The selector of special folders.
Definition: APIdefs_Environment.h:3613
Parameters to open a new project file.
Definition: APIdefs_Automate.h:214
API_FTypeID fileTypeID
file format to open
Definition: APIdefs_Automate.h:219
IO::Location * file
specification of the target file to open
Definition: APIdefs_Automate.h:240
bool useStoredLib
try to load the libraries specified in the project file. If the stored paths do not exist,...
Definition: APIdefs_Automate.h:229

◆ ACAPI_ProjectOperation_Print()

GSErrCode __ACENV_CALL ACAPI_ProjectOperation_Print ( const API_PrintPars printPars = nullptr)

Prints the content of the current window.

Parameters
printPars[in] Control parameters; optional, if missing, the current defaults will be used
Returns
  • NoError - The function has completed with success.
  • APIERR_REFUSEDCMD - The function is called from notification level
  • APIERR_NOPLAN - No open project
  • APIERR_BADPARS - printPars contains invalid data
Remarks
This function is used to print the content of the current window. This function performs a Print command in the server application. To get more details on the parametrization refer to the API_PrintPars structure. It cannot be called from notification level; the command is refused if other addons are running. Calling this function may notify other addons about 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.
Example
API_PrintPars printPars;
BNZeroMemory (&printPars, sizeof (API_PrintPars));
printPars.grid = true;
printPars.printArea = PrintArea_CurrentView;
printPars.fixText = false;
printPars.scale = 20;
GSErrCode err = ACAPI_Automate (APIDo_PrintID, &printPars, nullptr);
if (err == NoError)
ACAPI_WriteReport ("APIDo_PrintID ...OK", true);
short scale
Printing scale [1..30000]. Ignored if printArea or scaleToPaper is true.
Definition: APIdefs_Automate.h:744
bool fixText
Print text, arrowheads, and scale-independent dashed lines and fills at the actual size defined in th...
Definition: APIdefs_Automate.h:754
char printArea
Print the whole drawing or 3D projection fitting onto a page or print the current zoom or the content...
Definition: APIdefs_Automate.h:764
bool grid
Print also the construction grid lines.
Definition: APIdefs_Automate.h:749

◆ ACAPI_ProjectOperation_Project()

GSErrCode __ACENV_CALL ACAPI_ProjectOperation_Project ( API_ProjectInfo projectInfo)

Returns information on the current project file.

Parameters
projectInfo[out] Project file and teamwork project specific data.
Returns
  • NoError - No error occurred.
  • APIERR_BADPARS - projectInfo is nullptr.
  • APIERR_NOPLAN - No open project.
  • APIERR_MEMFULL - Low memory condition.
Remarks
This function is used to get information on the project file. In teamwork mode, the teamwork related data are also available. See the definitions of the returned parameters at API_ProjectInfo. The file specification is available only if the project file has been saved before. For 'untitled' project no data is returned. The dynamic memory allocated by this function will be deleted in the destructor of the API_ProjectInfo structure.
Example
API_ProjectInfo projectInfo = {};
ACAPI_Environment (APIEnv_ProjectID, &projectInfo);
Contains information about the current project.
Definition: APIdefs_Environment.h:229

◆ ACAPI_ProjectOperation_Publish()

GSErrCode __ACENV_CALL ACAPI_ProjectOperation_Publish ( const API_PublishPars publishPars,
const GS::Array< API_Guid > *  selectedLinks = nullptr 
)

Publishes a publisher set.

Parameters
publishPars[in] Control parameters; the guid member identifies the set to be published.
selectedLinks[in] Optional parameter; publish only these items.
Returns
  • NoError - The function has completed with success.
  • APIERR_REFUSEDCMD - The function is called from notification level.
  • APIERR_BADINDEX - The guid in publishPars is invalid.
  • APIERR_BADPARS - publishPars is nullptr, or no open project.
Remarks
This function publishes the given publisher set. To get more details on the parametrization refer to the API_PublishPars structure. 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.
Example
Please see the PublishTest()
function in the Navigator_Test example.

◆ ACAPI_ProjectOperation_Quit()

GSErrCode __ACENV_CALL ACAPI_ProjectOperation_Quit ( Int32  magicCode)

Terminates the server application.

Returns
  • NoError - The function has completed with success.
  • APIERR_REFUSEDCMD - the function is called from notification level
Remarks
This function is used to terminate the server application. 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. Not for public usage.

◆ ACAPI_ProjectOperation_ReloadLibraries()

GSErrCode __ACENV_CALL ACAPI_ProjectOperation_ReloadLibraries ( )

Resets and loads the active libraries.

Returns
  • NoError - The function has completed with success.
Remarks
This function is used to perform a Reload Libraries command in the server application. All the active libraries (included the BIMcloud and BIM Server Libraries too) will be reloaded.

◆ ACAPI_ProjectOperation_Save() [1/9]

GSErrCode __ACENV_CALL ACAPI_ProjectOperation_Save ( )

Saves the content of the current window in different file formats.

Since
Archicad 25
Returns
  • NoError - The function has completed with success
  • APIERR_REFUSEDCMD - The function is called from notification level, or you are running a demo version of Archicad
  • APIERR_READONLY - The plan could not be saved either because it's open in read-only mode, or has never been saved to a file and the fileSavePars is nullptr.
Remarks
This function is used to save the content of the current window in different file formats. This may change in case of API_SavePars_Pdf>. 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. It cannot be called in the demo version of Archicad either, because the API tries to mimic the behavior of the host system. 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.

◆ ACAPI_ProjectOperation_Save() [2/9]

GSErrCode __ACENV_CALL ACAPI_ProjectOperation_Save ( const API_FileSavePars fileSavePars)

Saves the content of the current window in different file formats.

Since
Archicad 25
Parameters
fileSavePars[in] Parameters of the saved file; optional, if not passed default settings will be used
Returns
  • NoError - The function has completed with success
  • APIERR_REFUSEDCMD - The function is called from notification level, or you are running a demo version of Archicad
  • APIERR_READONLY - The plan could not be saved either because it's open in read-only mode, or has never been saved to a file and the fileSavePars is nullptr.
Remarks
This function is used to save the content of the current window in different file formats. This may change in case of API_SavePars_Pdf>. 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. It cannot be called in the demo version of Archicad either, because the API tries to mimic the behavior of the host system. 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.

◆ ACAPI_ProjectOperation_Save() [3/9]

GSErrCode __ACENV_CALL ACAPI_ProjectOperation_Save ( const API_FileSavePars fileSavePars,
const API_SavePars_Archive formatPars 
)

Saves the content of the current window in different file formats.

Since
Archicad 25
Parameters
fileSavePars[in] Parameters of the saved file; optional, if not passed default settings will be used
formatPars[in] Parameters of the requested format. It can be either API_SavePars_Archive, API_SavePars_Ifc, API_SavePars_Plandump, API_SavePars_Object, API_SavePars_Picture, API_SavePars_Pdf or an API_SavePars_Saf record.
Returns
  • NoError - The function has completed with success
  • APIERR_REFUSEDCMD - The function is called from notification level, or you are running a demo version of Archicad
  • APIERR_READONLY - The plan could not be saved either because it's open in read-only mode, or has never been saved to a file and the fileSavePars is nullptr.
Remarks
This function is used to save the content of the current window in different file formats. This may change in case of API_SavePars_Pdf>. 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. It cannot be called in the demo version of Archicad either, because the API tries to mimic the behavior of the host system. 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.

◆ ACAPI_ProjectOperation_Save() [4/9]

GSErrCode __ACENV_CALL ACAPI_ProjectOperation_Save ( const API_FileSavePars fileSavePars,
const API_SavePars_Ifc formatPars,
API_IFCRelationshipData resultData = nullptr 
)

Saves the content of the current window in different file formats.

Since
Archicad 25
Parameters
fileSavePars[in] Parameters of the saved file; optional, if not passed default settings will be used
formatPars[in] Parameters of the requested format. It can be either API_SavePars_Archive, API_SavePars_Ifc, API_SavePars_Plandump, API_SavePars_Object, API_SavePars_Picture, API_SavePars_Pdf or an API_SavePars_Saf record.
resultData[out] Parameter for output data. Optionally it can be an API_IFCRelationshipData pointer while saving IFC.
Returns
  • NoError - The function has completed with success
  • APIERR_REFUSEDCMD - The function is called from notification level, or you are running a demo version of Archicad
  • APIERR_READONLY - The plan could not be saved either because it's open in read-only mode, or has never been saved to a file and the fileSavePars is nullptr.
Remarks
This function is used to save the content of the current window in different file formats. This may change in case of API_SavePars_Pdf>. 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. It cannot be called in the demo version of Archicad either, because the API tries to mimic the behavior of the host system. 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.

◆ ACAPI_ProjectOperation_Save() [5/9]

GSErrCode __ACENV_CALL ACAPI_ProjectOperation_Save ( const API_FileSavePars fileSavePars,
const API_SavePars_Object formatPars 
)

Saves the content of the current window in different file formats.

Since
Archicad 25
Parameters
fileSavePars[in] Parameters of the saved file; optional, if not passed default settings will be used
formatPars[in] Parameters of the requested format. It can be either API_SavePars_Archive, API_SavePars_Ifc, API_SavePars_Plandump, API_SavePars_Object, API_SavePars_Picture, API_SavePars_Pdf or an API_SavePars_Saf record.
Returns
  • NoError - The function has completed with success
  • APIERR_REFUSEDCMD - The function is called from notification level, or you are running a demo version of Archicad
  • APIERR_READONLY - The plan could not be saved either because it's open in read-only mode, or has never been saved to a file and the fileSavePars is nullptr.
Remarks
This function is used to save the content of the current window in different file formats. This may change in case of API_SavePars_Pdf>. 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. It cannot be called in the demo version of Archicad either, because the API tries to mimic the behavior of the host system. 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.

◆ ACAPI_ProjectOperation_Save() [6/9]

GSErrCode __ACENV_CALL ACAPI_ProjectOperation_Save ( const API_FileSavePars fileSavePars,
const API_SavePars_Pdf formatPars 
)

Saves the content of the current window in different file formats.

Since
Archicad 25
Parameters
fileSavePars[in] Parameters of the saved file; optional, if not passed default settings will be used
formatPars[in] Parameters of the requested format. It can be either API_SavePars_Archive, API_SavePars_Ifc, API_SavePars_Plandump, API_SavePars_Object, API_SavePars_Picture, API_SavePars_Pdf or an API_SavePars_Saf record.
Returns
  • NoError - The function has completed with success
  • APIERR_REFUSEDCMD - The function is called from notification level, or you are running a demo version of Archicad
  • APIERR_READONLY - The plan could not be saved either because it's open in read-only mode, or has never been saved to a file and the fileSavePars is nullptr.
Remarks
This function is used to save the content of the current window in different file formats. This may change in case of API_SavePars_Pdf>. 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. It cannot be called in the demo version of Archicad either, because the API tries to mimic the behavior of the host system. 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.

◆ ACAPI_ProjectOperation_Save() [7/9]

GSErrCode __ACENV_CALL ACAPI_ProjectOperation_Save ( const API_FileSavePars fileSavePars,
const API_SavePars_Picture formatPars 
)

Saves the content of the current window in different file formats.

Since
Archicad 25
Parameters
fileSavePars[in] Parameters of the saved file; optional, if not passed default settings will be used
formatPars[in] Parameters of the requested format. It can be either API_SavePars_Archive, API_SavePars_Ifc, API_SavePars_Plandump, API_SavePars_Object, API_SavePars_Picture, API_SavePars_Pdf or an API_SavePars_Saf record.
Returns
  • NoError - The function has completed with success
  • APIERR_REFUSEDCMD - The function is called from notification level, or you are running a demo version of Archicad
  • APIERR_READONLY - The plan could not be saved either because it's open in read-only mode, or has never been saved to a file and the fileSavePars is nullptr.
Remarks
This function is used to save the content of the current window in different file formats. This may change in case of API_SavePars_Pdf>. 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. It cannot be called in the demo version of Archicad either, because the API tries to mimic the behavior of the host system. 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.
Example
API_SavePars_Picture pars_pict = {};
GSErrCode err;
fsp.fileTypeID = APIFType_TIFFFile;
IO::Location folderLoc;
API_SpecFolderID specID = API_UserDocumentsFolderID;
ACAPI_Environment (APIEnv_GetSpecFolderID, &specID, &folderLoc);
fsp.file = new IO::Location (folderLoc, "PictTest.tif");
pars_pict.colorDepth = APIColorDepth_256C;
pars_pict.dithered = false;
pars_pict.view2D = true;
pars_pict.crop = true;
err = ACAPI_Automate (APIDo_SaveID, &fsp, &pars_pict);
if (err != NoError) {
char msgStr[256];
sprintf (msgStr, "Error in APIDo_SaveID (pict): %d", err);
ACAPI_WriteReport (msgStr, true);
}
delete fsp.file;
Parameters to save the current project file.
Definition: APIdefs_Automate.h:625
API_FTypeID fileTypeID
The output format.
Definition: APIdefs_Automate.h:630
IO::Location * file
The specification of the target file.
Definition: APIdefs_Automate.h:636
Contains the different options for saving pictures from Archicad.
Definition: APIdefs_Automate.h:383
bool crop
Save the picture with cropping to the current zoom (2D only).
Definition: APIdefs_Automate.h:403
API_ColorDepthID colorDepth
The bit depth of the picture (see API_ColorDepthID).
Definition: APIdefs_Automate.h:388
bool view2D
Save 2D or 3D view.
Definition: APIdefs_Automate.h:398
bool dithered
dithered picture (if less than or equal to 256 colors or grays)
Definition: APIdefs_Automate.h:393

◆ ACAPI_ProjectOperation_Save() [8/9]

GSErrCode __ACENV_CALL ACAPI_ProjectOperation_Save ( const API_FileSavePars fileSavePars,
const API_SavePars_PlanDump formatPars 
)

Saves the content of the current window in different file formats.

Since
Archicad 25
Parameters
fileSavePars[in] Parameters of the saved file; optional, if not passed default settings will be used
formatPars[in] Parameters of the requested format. It can be either API_SavePars_Archive, API_SavePars_Ifc, API_SavePars_Plandump, API_SavePars_Object, API_SavePars_Picture, API_SavePars_Pdf or an API_SavePars_Saf record.
Returns
  • NoError - The function has completed with success
  • APIERR_REFUSEDCMD - The function is called from notification level, or you are running a demo version of Archicad
  • APIERR_READONLY - The plan could not be saved either because it's open in read-only mode, or has never been saved to a file and the fileSavePars is nullptr.
Remarks
This function is used to save the content of the current window in different file formats. This may change in case of API_SavePars_Pdf>. 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. It cannot be called in the demo version of Archicad either, because the API tries to mimic the behavior of the host system. 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.

◆ ACAPI_ProjectOperation_Save() [9/9]

GSErrCode __ACENV_CALL ACAPI_ProjectOperation_Save ( const API_FileSavePars fileSavePars,
const API_SavePars_Saf formatPars 
)

Saves the content of the current window in different file formats.

Since
Archicad 25
Parameters
fileSavePars[in] Parameters of the saved file; optional, if not passed default settings will be used
formatPars[in] Parameters of the requested format. It can be either API_SavePars_Archive, API_SavePars_Ifc, API_SavePars_Plandump, API_SavePars_Object, API_SavePars_Picture, API_SavePars_Pdf or an API_SavePars_Saf record.
Returns
  • NoError - The function has completed with success
  • APIERR_REFUSEDCMD - The function is called from notification level, or you are running a demo version of Archicad
  • APIERR_READONLY - The plan could not be saved either because it's open in read-only mode, or has never been saved to a file and the fileSavePars is nullptr.
Remarks
This function is used to save the content of the current window in different file formats. This may change in case of API_SavePars_Pdf>. 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. It cannot be called in the demo version of Archicad either, because the API tries to mimic the behavior of the host system. 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.

◆ ACAPI_ProjectOperation_SaveAsModuleFile()

GSErrCode __ACENV_CALL ACAPI_ProjectOperation_SaveAsModuleFile ( const IO::Location *  location,
GS::Array< API_Elem_Head > *  elemHead = nullptr 
)

Saves the selected elements into a module file.

Parameters
location[in] Specifies the module file to be saved
elemHead[in] Elements to save into the module. Optional parameter, can be nullptr - in this case the current selection is saved
Returns
  • NoError - The function has completed with success.
  • APIERR_BADDATABASE - The current database must be floor plan, section/elevation or detail type
  • APIERR_BADPARS - The fileSpec parameter is nullptr or the file specified by fileSpec cannot be registered
  • APIERR_BADINDEX - There were no valid elements passed in the elemHead parameter
  • APIERR_GENERAL - Cannot create or write the module file
  • APIERR_MEMFULL - Low memory condition
Remarks
This function is used to create a module file from a selection of elements. The elements that the module should contain can be passed in the elemHead handle. If this parameter is nullptr, the function uses the current selection, similarly to the 'Save Selection as Module' menu command. The module file will not be created if there are no valid elements to save. Do not forget to release the elemHead handle when not needed any more. This function is a non-undoable data structure modifier function. See more details on this topic at Command Overview.
Example
/* save all elements in the current zoom as module file */
IO::Location location ("C:\\temp\\CurrentView.mod");
API_SelectionInfo selectionInfo;
GSErrCode err = NoError;
if (location.GetStatus () == NoError) {
BNZeroMemory (&selectionInfo, sizeof (API_SelectionInfo));
selectionInfo.typeID = API_MarqueeHorBox;
ACAPI_Database (APIDb_GetZoomID, &selectionInfo.marquee.box, nullptr);
err = ACAPI_Selection_SetMarquee (&selectionInfo); /* set the marquee rect to the current zoom */
}
if (err == NoError) {
err = ACAPI_Automate (APIDo_SaveAsModuleFileID, &location, nullptr);
BNZeroMemory (&selectionInfo, sizeof (API_SelectionInfo));
ACAPI_Selection_SetMarquee (&selectionInfo); /* remove the marquee */
}
GSErrCode __ACENV_CALL ACAPI_Selection_SetMarquee(API_SelectionInfo *selectionInfo)
Changes the current marquee selection.
API_Box box
the rectangle (in case rectangular representation)
Definition: APIdefs_Base.h:298
Information about the current selection.
Definition: APIdefs_Elements.h:18516
API_Region marquee
The parameters of the marquee selection region.
Definition: APIdefs_Elements.h:18547
API_SelTypeID typeID
The type of the selection. It can be one of the marquee type or element type selection.
Definition: APIdefs_Elements.h:18521

◆ ACAPI_Teamwork_ProjectSharing()

GSErrCode __ACENV_CALL ACAPI_Teamwork_ProjectSharing ( API_SharingInfo sharingInfo)

Returns the project sharing data in the case of a TeamWork project.

Parameters
sharingInfodata of the registered members of the team project
Returns
  • NoError - The function completed with success.
  • APIERR_BADPARS - sharingInfo is nullptr.
  • APIERR_NOPLAN - sharingInfo is nullptr.
  • APIERR_MEMFULL - Low memory condition.
Remarks
This function is used to get the registered members of the opened team project. Member data are returned through an array of API_UserInfo records. Do not forget to dispose the member data handle if it is not needed any more.
Example
API_SharingInfo sharingInfo;
Int32 i;
char buffer[256];
GSErrCode err;
BNZeroMemory (&sharingInfo, sizeof (API_SharingInfo));
err = ACAPI_Environment (APIEnv_ProjectSharingID, &sharingInfo, nullptr, nullptr);
if (err) {
GiveMessage_Err ("Error in APIEnv_ProjectSharingID", err);
return;
}
for (i = 0; i < sharingInfo.nUsers; i++) {
sprintf (buffer, " \"%10s\" id:%2d %s",
(*sharingInfo.users)[i].name,
(*sharingInfo.users)[i].userId,
(*sharingInfo.users)[i].connected ? "Connected" : "");
if ((*sharingInfo.users)[i].userId == projectInfo.userId)
buffer[0] = '*';
GiveMessage (buffer, false);
}
BMKillHandle ((GSHandle *) &sharingInfo.users);
Project sharing parameters.
Definition: APIdefs_Environment.h:462
API_UserInfo ** users
Data of each registered member.
Definition: APIdefs_Environment.h:472
Int32 nUsers
Number of registered members of the active project.
Definition: APIdefs_Environment.h:467