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

Functions related 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 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_PlanFile2700 , APIFType_A_PlanFile2700 , APIFType_PlanFile2800 ,
  APIFType_A_PlanFile2800 , APIFType_PlanFile2900 , APIFType_A_PlanFile2900 , 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 ACAPI_ProjectOperation_NewProject (const API_NewProjectPars *newProjectPars)
 Opens a new plan.
 
GSErrCode ACAPI_ProjectOperation_Open (const API_FileOpenPars *fileOpenPars)
 Opens a new project file.
 
GSErrCode ACAPI_ProjectOperation_Close ()
 Closes the current project window.
 
GSErrCode ACAPI_ProjectOperation_Save ()
 Saves the content of the current window in different file formats.
 
GSErrCode ACAPI_ProjectOperation_Save (const API_FileSavePars *fileSavePars)
 Saves the content of the current window in different file formats.
 
GSErrCode ACAPI_ProjectOperation_Save (const API_FileSavePars *fileSavePars, const API_SavePars_Archive *formatPars)
 Saves the content of the current window in different file formats.
 
GSErrCode ACAPI_ProjectOperation_Save (const API_FileSavePars *fileSavePars, const API_SavePars_PlanDump *formatPars)
 Saves the content of the current window in different file formats.
 
GSErrCode ACAPI_ProjectOperation_Save (const API_FileSavePars *fileSavePars, const API_SavePars_Object *formatPars)
 Saves the content of the current window in different file formats.
 
GSErrCode ACAPI_ProjectOperation_Save (const API_FileSavePars *fileSavePars, const API_SavePars_Picture *formatPars)
 Saves the content of the current window in different file formats.
 
GSErrCode 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 ACAPI_ProjectOperation_Save (const API_FileSavePars *fileSavePars, const API_SavePars_Pdf *formatPars)
 Saves the content of the current window in different file formats.
 
GSErrCode ACAPI_ProjectOperation_Save (const API_FileSavePars *fileSavePars, const API_SavePars_Saf *formatPars)
 Saves the content of the current window in different file formats.
 
GSErrCode ACAPI_ProjectOperation_ReloadLibraries ()
 Resets and loads the active libraries.
 
GSErrCode ACAPI_ProjectOperation_Print (const API_PrintPars *printPars=nullptr)
 Prints the content of the current window.
 
GSErrCode ACAPI_ProjectOperation_Quit ()
 Terminates the server application.
 
GSErrCode ACAPI_ProjectOperation_SaveAsModuleFile (const IO::Location *location, GS::Array< API_Elem_Head > *elemHead=nullptr)
 Saves the selected elements into a module file.
 
GSErrCode ACAPI_ProjectOperation_Publish (const API_PublishPars *publishPars, const GS::Array< API_Guid > *selectedLinks=nullptr)
 Publishes a publisher set.
 
GSErrCode ACAPI_ProjectOperation_Project (API_ProjectInfo *projectInfo)
 Returns information on the current project file.
 
GSErrCode ACAPI_Teamwork_ProjectSharing (API_SharingInfo *sharingInfo)
 Returns the project sharing data in the case of a TeamWork project.
 
GSErrCode ACAPI_ProjectOperation_GetMiscAppInfo (API_MiscAppInfo *miscAppInfo)
 Gets miscellaneous information about application.
 
GSErrCode ACAPI_ProjectOperation_GetMiscPrinterInfo (API_MiscPrinterInfo *miscPrinterInfo)
 Gets miscellaneous information about current printer.
 
GSErrCode ACAPI_ProjectOperation_GetMiscPlotterInfo (API_MiscPlotterInfo *miscPlotterInfo)
 Gets miscellaneous information about plotter.
 
GSErrCode ACAPI_ProjectOperation_GetPrinterPars (API_PrintPars *printPars)
 Retrieves the current printer settings.
 
GSErrCode ACAPI_ProjectOperation_AdditionalFileWasCreated (const IO::Location &path)
 Informs Archicad about the additional file created during exporting or publishing. Required for handling them with the target file. (E.g., uploading to BIMcloud together.)
 
GSErrCode 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 server application and various project-related events, such as saving or publishing the project.

Typedef Documentation

◆ APIProjectEventHandlerProc

typedef GSErrCode 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.
Enumerator
APIConvMod_TextGDL 

Write GDL Text in file (as a macro).

APIConvMod_MemGDL 

Convert into 3D model.

APIConvMod_SymTxtGDL 

Write as GDL Text in a symbol file.

APIConvMod_SymBinGDL 

Write as BINARY in a symbol file.

APIConvMod_SideGDL 

Convert to side view.

APIConvMod_DragGDL 

Create GDL script to drag-and-drop.

◆ API_ElementsToIfcExportID

Selected elements for IFC export.

Remarks
This type specifies in API_SavePars_Ifc.
Enumerator
API_EntireProject 

All elements in the current project.

API_VisibleElementsOnAllStories 

Visible elements on all stories

API_AllElementsOnCurrentStorey 

All elements on current storey

API_VisibleElementsOnCurrentStorey 

Visible elements on current storey

API_SelectedElementsOnly 

Selected elements only

API_FilteredElements 

Filtered elements

◆ API_ElementsToSAFExportID

Selected elements for SAF export.

Remarks
This type specifies in API_SavePars_Saf.
Enumerator
API_SAFSelectedElementsOnly 

Selected elements only.

API_SAFEntireProject 

Entire project.

API_SAFVisibleElements 

Visible elements.

◆ API_FTypeID

Available file format identifiers for automated functions.

Remarks
For the utilization of this structure see the ACAPI_ProjectOperation_Open and ACAPI_ProjectOperation_Save automation functions.
Enumerator
APIFType_None 

unknown file type

APIFType_PlanFile 

Archicad Solo Project File

APIFType_A_PlanFile 

Archicad Archive File

APIFType_Bak_PlanFile 

Archicad Backup File

APIFType_PlanFile600 

Archicad 6.0 Plan File

APIFType_A_PlanFile600 

Archicad 6.0 Archive File

APIFType_PlanFile650 

Archicad 6.5 Plan File

APIFType_A_PlanFile650 

Archicad 6.5 Archive File

APIFType_PlanFile700 

Archicad 7.0 Plan File

APIFType_A_PlanFile700 

Archicad 7.0 Archive File

APIFType_TabListFile 

Archicad List File with Tabs

APIFType_ObjectFile 

Archicad Object File

APIFType_DoorFile 

Archicad Door File

APIFType_WindowFile 

Archicad Window File

APIFType_GDLFile 

Archicad GDL File

APIFType_2DLinesFile 

2D Lines File

APIFType_PNGFile 

PNG File

APIFType_BMPFile 

Bitmap File

APIFType_TIFFFile 

TIFF File

APIFType_JPEGFile 

JPEG File

APIFType_GIFFile 

GIF File

APIFType_EMFFile 

Windows Enhanced Metafile

APIFType_WMFFile 

Windows Metafile

APIFType_PlanFile800 

Archicad 8 Plan File

APIFType_A_PlanFile800 

Archicad 8 Archive File

APIFType_PlanFile810 

Archicad 8.1 Plan File

APIFType_A_PlanFile810 

Archicad 8.1 Archive File

APIFType_PlanFile900 

Archicad 9.0 Plan File

APIFType_A_PlanFile900 

Archicad 9.0 Archive File

APIFType_PlanFile1000 

Archicad 10.0 Plan File

APIFType_A_PlanFile1000 

Archicad 10.0 Archive File

APIFType_PlanFile1100 

Archicad 11.0 Plan File

APIFType_A_PlanFile1100 

Archicad 11.0 Archive File

APIFType_PlanFile1200 

Archicad 12.0 Plan File

APIFType_A_PlanFile1200 

Archicad 12.0 Archive File

APIFType_IfcFile 

IFC File

APIFType_PlanFile1300 

Archicad 13 Plan File

APIFType_A_PlanFile1300 

Archicad 13 Archive File

APIFType_PlanFile1400 

Archicad 14 Plan File

APIFType_A_PlanFile1400 

Archicad 14 Archive File

APIFType_PlanFile1500 

Archicad 15 Plan File

APIFType_A_PlanFile1500 

Archicad 15 Archive File

APIFType_PlanFile1600 

Archicad 16 Plan File

APIFType_A_PlanFile1600 

Archicad 16 Archive File

APIFType_PlanFile1700 

Archicad 17 Plan File

APIFType_A_PlanFile1700 

Archicad 17 Archive File

APIFType_PlanFile1800 

Archicad 18 Plan File

APIFType_A_PlanFile1800 

Archicad 18 Archive File

APIFType_PdfFile 

PDF File

APIFType_PlanFile1900 

Archicad 19 Plan File

APIFType_A_PlanFile1900 

Archicad 19 Archive File

APIFType_PlanFile2000 

Archicad 20 Plan File

APIFType_A_PlanFile2000 

Archicad 20 Archive File

APIFType_PlanFile2100 

Archicad 21 Plan File

APIFType_A_PlanFile2100 

Archicad 21 Archive File

APIFType_PlanFile2200 

Archicad 22 Plan File

APIFType_A_PlanFile2200 

Archicad 22 Archive File

APIFType_PlanFile2300 

Archicad 23 Plan File

APIFType_A_PlanFile2300 

Archicad 23 Archive File

APIFType_PlanFile2400 

Archicad 24 Plan File

APIFType_A_PlanFile2400 

Archicad 24 Archive File

APIFType_PlanFile2500 

Archicad 25 Plan File

APIFType_A_PlanFile2500 

Archicad 25 Archive File

APIFType_PlanFile2600 

Archicad 26 Plan File

APIFType_A_PlanFile2600 

Archicad 26 Archive File

APIFType_PlanFile2700 

Archicad 27 Plan File

APIFType_A_PlanFile2700 

Archicad 27 Archive File

APIFType_PlanFile2800 

Archicad 28 Plan File

APIFType_A_PlanFile2800 

Archicad 28 Archive File

APIFType_PlanFile2900 

Archicad 29 Plan File

APIFType_A_PlanFile2900 

Archicad 29 Archive File

APIFType_SafFile 

SAF File

◆ API_IfcTypeID

Defines type of file format for IFC Export.

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

Defines IFC file format.

API_IFCZIP 

Defines IFC ZIP file format.

◆ API_NotifyEventID

Possible values for notifications on project events.

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

The user chose New from the File menu.

APINotify_NewAndReset 

The user chose New & Reset from the File menu.

APINotify_Open 

The user opened an existing project.

APINotify_PreSave 

The user has chosen Save from the File menu; this notification is coming before the actual save is performed, so that you could save some data into the project file. Please try to avoid using this method if not necessary, because it can significantly slow down the file saving process. Rather store the additional data into the project when they actually change.

APINotify_Save 

The user has chosen Save from the File menu; the project has already been saved.

APINotify_Close 

The user closed the current project.

APINotify_Quit 

The user chose Quit from the File menu.

APINotify_TempSave 

The project is about to be autosaved.

APINotify_SendChanges 

The user is about to send changes into the Teamwork project.

APINotify_ReceiveChanges 

The user has received the changes from the Teamwork project.

APINotify_ChangeProjectDB 

The project database changed.

APINotify_ChangeWindow 

The current window changed.

APINotify_ChangeFloor 

The user switched to an other floor.

APINotify_ChangeLibrary 

The loaded libraries were changed.

APINotify_AllInputFinished 

Sent when an input process (open, merge, etc.) is finished.

APINotify_UnitChanged 

Notifies that the working units or calculation units have changed on Preferences dialogs.

APINotify_SideviewCreated 

The section/elevation/interior elevation was generated. The first time its window was opened.

APINotify_SideviewRebuilt 

The section/elevation/interior elevation was rebuilt.

APINotify_PropertyVisibilityChanged 

Notifies that Property visibility has changed.

APINotify_ClassificationVisibilityChanged 

Notifies that Classification visibility has changed.

APINotify_ShowIn3DChanged 

This notification is sent when the user has chosen Show Selection in 3D / Show All in 3D / Show stored selection in 3D.

◆ API_NotifyViewEventID

Possible values for notifications on Project Navigator events.

Remarks
Refer to ACAPI_Notification_CatchViewEvent function for further details.
Enumerator
APINotifyView_Inserted 

A new Project Navigator item was inserted.

APINotifyView_Modified 

A Project Navigator item was modified.

APINotifyView_Deleted 

A Project Navigator item was deleted.

APINotifyView_Opened 

A Project Navigator item was opened.

APINotifyView_Begin 

The begin notification.

APINotifyView_End 

The end notification.

Function Documentation

◆ ACAPI_ProjectOperation_AdditionalFileWasCreated()

GSErrCode ACAPI_ProjectOperation_AdditionalFileWasCreated ( const IO::Location & path)

Informs Archicad about the additional file created 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 successfully.

◆ ACAPI_ProjectOperation_CatchProjectEvent()

GSErrCode 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
// -----------------------------------------------------------------------------
GSErrCode 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 Initialize ()
{
// catch changes in project events
GSErrCode err = ACAPI_ProjectOperation_CatchProjectEvent (API_AllProjectNotificationMask, NotificationHandler);
return err;
}

◆ ACAPI_ProjectOperation_Close()

GSErrCode ACAPI_ProjectOperation_Close ( )

Closes the current project window.

Returns
  • NoError - The function completed successfully.
  • APIERR_REFUSEDCMD - The command is not allowed to be called.
  • 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 add-ons are running. Calling this function may notify other add-ons of the event. The caller add-on does not get any notification. See the Notification Manager for further details. This function performs complete operations, so it cannot be called during undoable operations or non-undoable commands. See more details on this topic at Command Overview. Not for public use.

◆ ACAPI_ProjectOperation_GetMiscAppInfo()

GSErrCode 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 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 {};

◆ ACAPI_ProjectOperation_GetMiscPrinterInfo()

GSErrCode 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 {};

◆ ACAPI_ProjectOperation_GetPrinterPars()

GSErrCode 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 {};
GSErrCode err = ACAPI_ProjectOperation_GetPrinterPars (&printPars);
double pageWidth, pageHeight;
if (err == NoError) {
pageWidth = printPars.right - printPars.left;
pageHeight = printPars.bottom - printPars.top;
} else {
pageWidth = 0.20142199;
pageHeight = 0.28858633;
}

◆ ACAPI_ProjectOperation_NewProject()

GSErrCode ACAPI_ProjectOperation_NewProject ( const API_NewProjectPars * newProjectPars)

Opens a new plan.

Parameters
newProjectPars[in] Parameters for opening a new project.
Returns
  • NoError - The function completed successfully.
  • APIERR_BADPARS - newProjectPars is nullptr.
  • APIERR_REFUSEDCMD - The function is called from notification level.
Remarks
This function is used to perform a New or New and Reset command in the server application. It cannot be called from notification level; the command is refused if other add-ons are running. Calling this function may notify other add-ons of the event. The caller add-on does not get any notification. See the Notification Manager for further details. This function performs complete operations, so it cannot be called during undoable operations or non-undoable commands. See more details on this topic at Command Overview. If the plan is not saved, any modifications made will be lost.
Example
API_NewProjectPars newPlanPars {};
newPlanPars.newAndReset = true;

◆ ACAPI_ProjectOperation_Open()

GSErrCode 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 completed successfully.
  • APIERR_BADPARS - fileOpenPars or fileOpenPars->file is nullptr, or fileOpenPars->file is not a valid location, or fileOpenPars->archiveLib is nullptr if fileOpenPars->libGiven is true.
  • APIERR_BADID - fileOpenPars->fileTypeID is an 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 add-ons are running. Calling this function may notify other add-ons of the event. The caller add-on does not get any notification. See the Notification Manager for further details. This function performs complete operations, so it cannot be called during undoable operations or non-undoable commands. See more details on this topic at Command Overview. If the plan is not saved, any modifications made will be lost.
Example
API_FileOpenPars openPars {};
openPars.useStoredLib = true;
IO::Location folderLoc;
folderLoc.AppendToLocal (IO::Name ("Archicad Examples"));
folderLoc.AppendToLocal (IO::Name ("Residential House"));
openPars.file = new IO::Location (folderLoc, IO::Name ("Residential House.pla"));
GSErrCode err = ACAPI_ProjectOperation_Open (&openPars);
if (err != NoError)
ACAPI_WriteReport ("Cannot open the file", true);
delete openPars.file;

◆ ACAPI_ProjectOperation_Print()

GSErrCode 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 completed successfully.
  • 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 {};
printPars.grid = true;
printPars.printArea = PrintArea_CurrentView;
printPars.fixText = false;
printPars.scale = 20;
GSErrCode err = ACAPI_ProjectOperation_Print (&printPars);
if (err == NoError)
ACAPI_WriteReport ("APIDo_PrintID ...OK", true);

◆ ACAPI_ProjectOperation_Project()

GSErrCode 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_ProjectOperation_Publish()

GSErrCode 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 completed successfully.
  • 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 ACAPI_ProjectOperation_Quit ( )

Terminates the server application.

Returns
  • NoError - The function completed successfully.
  • 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 ACAPI_ProjectOperation_ReloadLibraries ( )

Resets and loads the active libraries.

Returns
  • NoError - The function completed successfully.
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 ACAPI_ProjectOperation_Save ( )

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

Since
Archicad 25
Returns
  • NoError - The function completed successfully.
  • 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 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 completed successfully.
  • 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 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 completed successfully.
  • 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 fileSavePars is nullptr.
Remarks
This function is used to save the content of the current window in different file formats. This may change in the case of API_SavePars_Pdf. It cannot be called from notification level; the command is refused if other add-ons are running. Calling this function may notify other add-ons of the event. The caller add-on 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 during undoable or non-undoable commands. See more details on this topic at Command Overview.

◆ ACAPI_ProjectOperation_Save() [4/9]

GSErrCode 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 completed successfully.
  • 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 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 completed successfully.
  • 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 fileSavePars is nullptr.
Remarks
This function is used to save the content of the current window in different file formats. This may change in the case of API_SavePars_Pdf. It cannot be called from notification level; the command is refused if other add-ons are running. Calling this function may notify other add-ons of the event. The caller add-on 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 during undoable or non-undoable commands. See more details on this topic at Command Overview.

◆ ACAPI_ProjectOperation_Save() [6/9]

GSErrCode 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 completed successfully.
  • 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 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 successfully
  • 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;
fsp.file = new IO::Location (folderLoc, IO::Name ("PictTest.tif"));
pars_pict.colorDepth = APIColorDepth_256C;
pars_pict.dithered = false;
pars_pict.view2D = true;
pars_pict.crop = true;
err = ACAPI_ProjectOperation_Save (&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;

◆ ACAPI_ProjectOperation_Save() [8/9]

GSErrCode 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 completed successfully.
  • 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 fileSavePars is nullptr.
Remarks
This function is used to save the content of the current window in different file formats. This may change in the case of API_SavePars_Pdf. It cannot be called from notification level; the command is refused if other add-ons are running. Calling this function may notify other add-ons of the event. The caller add-on 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 during undoable or non-undoable commands. See more details on this topic at Command Overview.

◆ ACAPI_ProjectOperation_Save() [9/9]

GSErrCode 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 completed successfully.
  • 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 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 completed successfully.
  • 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) {
selectionInfo.typeID = API_MarqueeHorBox;
ACAPI_View_GetZoom (&selectionInfo.marquee.box, nullptr);
err = ACAPI_Selection_SetMarquee (&selectionInfo); /* set the marquee rect to the current zoom */
}
if (err == NoError) {
err = ACAPI_ProjectOperation_SaveAsModuleFile (&location, nullptr);
selectionInfo = {};
ACAPI_Selection_SetMarquee (&selectionInfo); /* remove the marquee */
}

◆ ACAPI_Teamwork_ProjectSharing()

GSErrCode 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;
err = ACAPI_Teamwork_ProjectSharing (&sharingInfo);
if (err) {
WriteReport_Err ("Error in APIEnv_ProjectSharingID", err);
return;
}
for (i = 0; i < sharingInfo.nUsers; i++) {
sprintf (buffer, " \"%10s\" id:%2d %s",
GS::UniString ((*sharingInfo.users)[i].fullName).ToCStr ().Get (),
(*sharingInfo.users)[i].userId,
(*sharingInfo.users)[i].connected ? "Connected" : "");
if ((*sharingInfo.users)[i].userId == projectInfo.userId)
buffer[0] = '*';
ACAPI_WriteReport (buffer, false);
}
BMKillHandle ((GSHandle *) &sharingInfo.users);