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

Export To XMLFileFormat

Nayan
Booster
I am working on an add-ons where I need to export user data as XML format. For this I have included DGLib, GSXMULtils, GSXML and InputOutput Module library to my project using the CMakelists (Using the archicad add-on template for the development).
But getting an error in "FormatXMLDoc(document, &xmlFile)" method and not getting any idea what's doing wrong here becuase in the Property_test Example add-on it works file.
Can anyone kindly help me on this?

N.B. Attached are the error and the code snippet for this.
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Viktor Kovacs
Graphisoft
Graphisoft
I think I found the error. The CMake template is updated on GitHub, and it seems you started from the old version. Please try to modify your CMakeLists.txt like this:
https://github.com/GRAPHISOFT/archicad-addon-cmake/commit/646a7067667586e38eff3e3378d24de7f2c58abc

View solution in original post

7 REPLIES 7
Viktor Kovacs
Graphisoft
Graphisoft
I've checked with your settings, and it works fine for me. Could you please specify which Archicad version are you targeting, and what version of Visual Studio are you using?
Nayan
Booster
Viktor wrote:
I've checked with your settings, and it works fine for me. Could you please specify which Archicad version are you targeting, and what version of Visual Studio are you using?
I am targeting Archicad version 24. And for Visual Studio IDE I have tried with both VS2017 and VS2019 but getting the same error.
N.B. For CMake build I have used VS2017.
Nayan
Booster
Viktor wrote:
I've checked with your settings, and it works fine for me. Could you please specify which Archicad version are you targeting, and what version of Visual Studio are you using?
Hi Viktor Kovacs, any suggestion or idea on this error, what's possibly I'm doing wrong here?
Viktor Kovacs
Graphisoft
Graphisoft
Unfortunately I have no idea. If you have a minimal repro and you can attach it here as a zip file I can check it on my computer.
Nayan
Booster
Viktor wrote:
Unfortunately I have no idea. If you have a minimal repro and you can attach it here as a zip file I can check it on my computer.
Dear Viktor Kovacs, Here I have attached the project in zip format.
I have added the minimal code for the XML export that simulates my error.
You can find the XML export related code in TemplateDialog.cpp file.

N.B. Attached pic is the error snapshot I am facing and I have used the CMake build. (ARCHICAD 24 & VS2017)
Solution
Viktor Kovacs
Graphisoft
Graphisoft
I think I found the error. The CMake template is updated on GitHub, and it seems you started from the old version. Please try to modify your CMakeLists.txt like this:
https://github.com/GRAPHISOFT/archicad-addon-cmake/commit/646a7067667586e38eff3e3378d24de7f2c58abc
Nayan
Booster
Viktor wrote:
I think I found the error. The CMake template is updated on GitHub, and it seems you started from the old version. Please try to modify your CMakeLists.txt like this:
https://github.com/GRAPHISOFT/archicad-addon-cmake/commit/646a7067667586e38eff3e3378d24de7f2c58abc
Updated the CMakelists.txt file and seems the error has resolved.
Thank you so much for your time and support.