We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

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

Write Report

poco2013
Mentor
This question has been asked before but I don't think there has been a satisfactory answer.

The WriteReport function in the examples is not writing to the Session Report.

Is there another location other than the Session Report?

I have checked the Write report check box and set the slider to full. under model Rebuild Options.

Using ver 22 on PC.
Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
dfintha
Graphisoft Alumni
Graphisoft Alumni
Hi,

The WriteReport function is defined in the APICommon.c file, which contains several helper functions, which are not part of the API itself, but utilize it. It sinply acts as a wrapper over the ACAPI_WriteReport and DBPrintf functions.

The ACAPI_WriteReport function itself has two modes. It either prints its output to the Session Report, or in an alert box.

The DBPrintf function can print output to a Debugger (if one is present and attached), as such, it should only be used for debugging.

The lines starting with # are processed by the C/C++ preprocessor. The most frequent directives are #include, #define, and #if. The latter two are mostly used for conditional compilation.
You can find more information about these directives here.

If you want to be certain, that you write to the Session Report, you should use ACAPI_WriteReport directly.

Best regards,
Dénes

View solution in original post

3 REPLIES 3
poco2013
Mentor
UPDATE:

I looked at this again and found that the function WriteReport() is being defined in the APICommon.c file.

However the redefinition to ACAPI_Writereport is either being redefined or skipped by using a # directive at the start of the line.

Does anyone know what the # sign is suppose to do in VS and how to utilize it?

EDIT:
OK - figured it out but don't know why Archicad would omit the writereport function by default? Don't know what the DBprint does instead?
Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27
Solution
dfintha
Graphisoft Alumni
Graphisoft Alumni
Hi,

The WriteReport function is defined in the APICommon.c file, which contains several helper functions, which are not part of the API itself, but utilize it. It sinply acts as a wrapper over the ACAPI_WriteReport and DBPrintf functions.

The ACAPI_WriteReport function itself has two modes. It either prints its output to the Session Report, or in an alert box.

The DBPrintf function can print output to a Debugger (if one is present and attached), as such, it should only be used for debugging.

The lines starting with # are processed by the C/C++ preprocessor. The most frequent directives are #include, #define, and #if. The latter two are mostly used for conditional compilation.
You can find more information about these directives here.

If you want to be certain, that you write to the Session Report, you should use ACAPI_WriteReport directly.

Best regards,
Dénes
poco2013
Mentor
Hi

Thanks for the update.
Very Helpful.
Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27