Archicad C++ API
About Archicad add-on development using the C++ API.
SOLVED!

Process Window not working in MacOS

Aathil
Contributor

I have a simple process window that is working properly in Windows. But it is not even showing in MacOS.

Below is a simplified version of my code :

 

Int32 maxPercentageValue = 100;
GS::UniString title("Title");
GS::UniString subTitle("subTitle");
int renderPhaseCount = 10;

ACAPI_Interface(APIIo_InitProcessWindowID, &title, &renderPhaseCount);
ACAPI_Interface(APIIo_SetNextProcessPhaseID, &subTitle, &maxPercentageValue);

//Start rendering different sets of elements(walls, stairs, doors...) where each set 
//corresponds to different phases of the process window


for(int i=0;i<totalElementsInCurrentSet;i++){
// Render one element from the set
...

//Update process window
Int32 percentage = (Int32) i*100/totalElementsInCurrentSet;
ACAPI_Interface(APIIo_SetProcessValueID, &percentage,NULL)
}


ACAPI_Interface(APIIo_SetNextProcessPhaseID, &subTitle, &maxPercentageValue);

// Do the same for the next set...


//Close process window after completion of rendering
ACAPI_Interface(APIIo_CloseProcessWindowID, NULL, NULL);

//Show render report( I don't know if this code affects the process window or not)
DGAlert(DG_INFORMATION, "Render report", "Done", "", "OK");

 

 

 I tried the example Addons(Communication_Manager, DG_Test), the process window is showing properly for those in MacOS. 

 

Any help is appreciated. 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Viktor Kovacs
Graphisoft
Graphisoft

On mac you need to call APIIo_IsProcessCanceledID after APIIo_SetProcessValueID for the process window to appear. It is also recommended to handle the return value and stop the process if it returns true.

View solution in original post

3 REPLIES 3
Solution
Viktor Kovacs
Graphisoft
Graphisoft

On mac you need to call APIIo_IsProcessCanceledID after APIIo_SetProcessValueID for the process window to appear. It is also recommended to handle the return value and stop the process if it returns true.

Aathil
Contributor

Thanks @Viktor Kovacs . That fixed the issue. 
Also just wondering... Is there any way to control the behaviour of the process window on mouse-hover? I wanted to show a different text message than "Abort".

Viktor Kovacs
Graphisoft
Graphisoft

As far as I know you can't modify the abort text.