Archicad 27 C++ API
Loading...
Searching...
No Matches
Process Windows

Functions related to the Process Control (Process Window). More...

Enumerations

enum  API_ProcessControlTypeID { API_MenuCommandEnabled , API_MenuCommandDisabled }
 Process control types. More...
 

Functions

GSErrCode __ACENV_CALL ACAPI_ProcessWindow_GetProcessControl (GS::ProcessControl **processControl)
 Returns the actual process control from Archicad.
 
GSErrCode __ACENV_CALL ACAPI_ProcessWindow_SetInnerProcessControl (GS::ProcessControl *processControl=nullptr)
 Sets the given process control to Archicad.
 
GSErrCode __ACENV_CALL ACAPI_ProcessWindow_InitProcessWindow (const GS::UniString *title=nullptr, Int32 *nPhase=nullptr, API_ProcessControlTypeID *processCntrolType=nullptr)
 Opens the process window.
 
GSErrCode __ACENV_CALL ACAPI_ProcessWindow_CloseProcessWindow ()
 Closes the process window.
 
GSErrCode __ACENV_CALL ACAPI_ProcessWindow_SetNextProcessPhase (const GS::UniString *subtitle, Int32 *maxval, bool *showPercent=nullptr)
 Starts the next process phase in the process window.
 
GSErrCode __ACENV_CALL ACAPI_ProcessWindow_SetProcessValue (Int32 *newval)
 Sets the value of the progress bar.
 
GSErrCode __ACENV_CALL ACAPI_ProcessWindow_IncProcessValue (Int32 *incval=nullptr)
 Increases the value of the progress bar.
 
GSErrCode __ACENV_CALL ACAPI_ProcessWindow_IsProcessCanceled ()
 Checks for user breaks during long processes.
 
GSErrCode __ACENV_CALL ACAPI_ProcessWindow_SetProcessOnOffSwitch (bool *switchOff)
 Turns the process window on/off.
 
GSErrCode __ACENV_CALL ACAPI_ProcessWindow_GetProcessOnOffSwitch (bool *param)
 Returns whether the process window will appear.
 

Detailed Description

Functions related to the Process Control (Process Window).

Enumeration Type Documentation

◆ API_ProcessControlTypeID

Process control types.

Remarks
Used in ACAPI_ProcessWindow_InitProcessWindow.

Function Documentation

◆ ACAPI_ProcessWindow_CloseProcessWindow()

GSErrCode __ACENV_CALL ACAPI_ProcessWindow_CloseProcessWindow ( )

Closes the process window.

Returns
  • NoError - The function always returns NoError.
Remarks
This function is used to close the process window opened with ACAPI_ProcessWindow_InitProcessWindow.
Example
See APIIo_InitProcessWindowID
for example of using process windows.

◆ ACAPI_ProcessWindow_GetProcessControl()

GSErrCode __ACENV_CALL ACAPI_ProcessWindow_GetProcessControl ( GS::ProcessControl **  processControl)

Returns the actual process control from Archicad.

Parameters
processControl[out]
Returns
  • NoError - The function has completed with success.

◆ ACAPI_ProcessWindow_GetProcessOnOffSwitch()

GSErrCode __ACENV_CALL ACAPI_ProcessWindow_GetProcessOnOffSwitch ( bool *  param)

Returns whether the process window will appear.

Parameters
param[out] returns the current state.
Returns
  • NoError - The function has completed with success.

◆ ACAPI_ProcessWindow_IncProcessValue()

GSErrCode __ACENV_CALL ACAPI_ProcessWindow_IncProcessValue ( Int32 *  incval = nullptr)

Increases the value of the progress bar.

Parameters
incval[in] The value to add to the progress bar in the current process phase.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - incval is nullptr
Remarks
This function is used to increase the progress bar value of the current phase in the process window. The increment should be passed in the incval parameter. Use the ACAPI_ProcessWindow_SetProcessValue function to set the process value to a given value, instead of increasing the current one.
Example
See APIIo_InitProcessWindowID
for example of using process windows.

◆ ACAPI_ProcessWindow_InitProcessWindow()

GSErrCode __ACENV_CALL ACAPI_ProcessWindow_InitProcessWindow ( const GS::UniString *  title = nullptr,
Int32 *  nPhase = nullptr,
API_ProcessControlTypeID processCntrolType = nullptr 
)

Opens the process window.

Parameters
title[in] Process string.
nPhase[in] Number of phases.
processCntrolType[in]
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - nPhase is nullptr
Remarks
This function is used to prepare the process window for a long operation. You can specify the name of the whole operation and the number of the phases of the process. Other process window related functions are:
Example
GSErrCode err;
API_LibPart libPart;
GS::UniString title ("Listing the library");
GS::UniString subtitle ("working...");
short nPhase;
Int32 i, nLib;
char buffer [256];
if (nLib > 0) {
nPhase = 1;
ACAPI_Interface (APIIo_InitProcessWindowID, &title, &nPhase);
ACAPI_Interface (APIIo_SetNextProcessPhaseID, &subtitle, &nLib);
BNZeroMemory (&libPart, sizeof (API_LibPart));
for (i = 1; i <= nLib; i++) {
libPart.index = i;
err = ACAPI_LibraryPart_Get (&libPart);
if (!err) {
sprintf (buffer, "[%2d] \"%s\"", i, (const char *) GS::UniString (libPart.docu_UName).ToCStr ());
ACAPI_WriteReport (buffer, false);
}
ACAPI_Interface (APIIo_SetProcessValueID, &i, nullptr);
if (ACAPI_Interface (APIIo_IsProcessCanceledID, nullptr, nullptr))
break;
}
ACAPI_Interface (APIIo_CloseProcessWindowID, nullptr, nullptr);
}
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_LibraryPart_GetNum(Int32 *count)
Returns the number of registered library parts.
GSErrCode __ACENV_CALL ACAPI_LibraryPart_Get(API_LibPart *libPart)
Returns the data of a registered Library Part.
Definition of a Library Part.
Definition: APIdefs_LibraryParts.h:77
Int32 index
Index of the Library Part, contains the current database index of the given Library Part....
Definition: APIdefs_LibraryParts.h:88
GS::uchar_t docu_UName[API_UniLongNameLen]
Unique document name of the Library Part. If more than one Library Part has the same name,...
Definition: APIdefs_LibraryParts.h:95

◆ ACAPI_ProcessWindow_IsProcessCanceled()

GSErrCode __ACENV_CALL ACAPI_ProcessWindow_IsProcessCanceled ( )

Checks for user breaks during long processes.

Returns
  • NoError - The function has completed with success.
  • APIERR_CANCEL - The current process was canceled
Remarks
This function is used to check whether the user has canceled a long process (by clicking on the Cancel button of the process window, or by pressing the appropriate keys on the keyboard). It also give visual feedback on processing by changing the cursor shape.
Example
See APIIo_InitProcessWindowID
for example of using process windows.

◆ ACAPI_ProcessWindow_SetInnerProcessControl()

GSErrCode __ACENV_CALL ACAPI_ProcessWindow_SetInnerProcessControl ( GS::ProcessControl *  processControl = nullptr)

Sets the given process control to Archicad.

Parameters
processControl[in] Can be nullptr.
Returns
  • NoError - The function has completed with success.

◆ ACAPI_ProcessWindow_SetNextProcessPhase()

GSErrCode __ACENV_CALL ACAPI_ProcessWindow_SetNextProcessPhase ( const GS::UniString *  subtitle,
Int32 *  maxval,
bool *  showPercent = nullptr 
)

Starts the next process phase in the process window.

Parameters
subtitle[in] Description of the process phase.
maxval[in] Maximum value of the progress bar.
showPercent[in] Show phase percentage. (optional)
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - maxval is nullptr
Remarks
This function is used to reinitialize the process window for the next process phase during a long operation. Set some description about the process phase in the subtitle parameter. The progress bar will be divided up according to the value of the maxval parameter.
Example
See APIIo_InitProcessWindowID
for example of using process windows.

◆ ACAPI_ProcessWindow_SetProcessOnOffSwitch()

GSErrCode __ACENV_CALL ACAPI_ProcessWindow_SetProcessOnOffSwitch ( bool *  switchOff)

Turns the process window on/off.

Parameters
switchOff[in] sets the current state.
Returns
  • NoError - The function has completed with success.

◆ ACAPI_ProcessWindow_SetProcessValue()

GSErrCode __ACENV_CALL ACAPI_ProcessWindow_SetProcessValue ( Int32 *  newval)

Sets the value of the progress bar.

Parameters
newval[in] The new value of the progress bar in the current process phase.
Returns
  • NoError - The function has completed with success.
  • APIERR_BADPARS - newval is nullptr
Remarks
This function is used to set the progress bar value of the current phase in the process window. Use the ACAPI_ProcessWindow_IncProcessValue function to increment the process value, instead of setting it to a given value.
Example
See APIIo_InitProcessWindowID
for example of using process windows.