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!

Libraries Exel, XML, FILE

UFO
Contributor

"Hello, I decided to ask 3 questions in one topic.
Advise on which libraries are best to use for the following functions in Archicad add-ons:

  1. Connection with Excel (mainly simple level of cell queries back and forth)
  2. Saving application constants available for user editing (preferably XML)
  3. Writing to a file for exception logging (something that survives Archicad crashes)

    Recommend what you have personally used specifically in Archicad add-ons!"
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Joel Buehler
Enthusiast

hehey UFO, i hope some other developers post how they see your questions. i see it this way:

 

1. The Archicad SDK comes with the libxl library. no need to feed your own library as resource to the add-on. just include the header and your good to go. you can use the documentation from them and start hacking. very cool. even a few of the add-on examples use the library. 

https://www.libxl.com/

 

2. ACAPI_Set/GetPreferences is my guy

A very cool and convenient way to store global data. i cant answer for you how well protected the preferences file is, if you want to store login data or something like this. (the api even comes with encryption libs, too!)  forget the usage of this api like they show in the examples. unless you want to deep dive c. use it like its shown in the archicad maze tutorial. since you can feed wahtever you want to the api, you of course can save XML or JSON data. if you dont do some sort of Web API calls where you work with the XML/JSON data, i wouldnt even bother to do serialization and deserialization to XML. just save your object to the preferences. you even can save nested objects. 

https://graphisoft.github.io/archicad-api-devkit/group___preferences.html

https://archicadapi.graphisoft.com/archicad-maze-generator-add-on-tutorial-part-3

 

 

3. cant answer that one. 

 

 

View solution in original post

2 REPLIES 2
Solution
Joel Buehler
Enthusiast

hehey UFO, i hope some other developers post how they see your questions. i see it this way:

 

1. The Archicad SDK comes with the libxl library. no need to feed your own library as resource to the add-on. just include the header and your good to go. you can use the documentation from them and start hacking. very cool. even a few of the add-on examples use the library. 

https://www.libxl.com/

 

2. ACAPI_Set/GetPreferences is my guy

A very cool and convenient way to store global data. i cant answer for you how well protected the preferences file is, if you want to store login data or something like this. (the api even comes with encryption libs, too!)  forget the usage of this api like they show in the examples. unless you want to deep dive c. use it like its shown in the archicad maze tutorial. since you can feed wahtever you want to the api, you of course can save XML or JSON data. if you dont do some sort of Web API calls where you work with the XML/JSON data, i wouldnt even bother to do serialization and deserialization to XML. just save your object to the preferences. you even can save nested objects. 

https://graphisoft.github.io/archicad-api-devkit/group___preferences.html

https://archicadapi.graphisoft.com/archicad-maze-generator-add-on-tutorial-part-3

 

 

3. cant answer that one. 

 

 

Thank you for the response.

1. Yes, that's exactly what I needed (just didn't see it in the documentation, so I didn't think to look in the provided libraries).
2. The path to saving data in Archicad files will work for me, but creating modal dialogs is too cumbersome, so I'm looking for a way to create a simple configuration that the user could customize. I'm thinking in the direction of an XML file. Your answer also helped me here; it turns out there are examples of working with XML in the samples (although there is no documentation, you can figure it out), and the GS library for working with XML also exists.
3. Let's wait, maybe someone will share their experience. Any suggestions are welcome, in any case, doing something is better than doing nothing.