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

Best way for Serialization?

Joel Buehler

Hehey evryone. 


Id like that my user can save his work he did in my plugin into an add-on object. but my project object is quite big and im not firm enough in cpp to write for all sub-objects memmory read and write methods. so i had the idea that i just serialize my object and save the json or xml string into the add-on object. unfortunately in cpp serialization is also a difficult topic.. but did someone do this before and can share some tipps and tricks?  


i see that we have in the AddOnCommandTest example some sort of JSON deserialization and in the goodies example there is a small xml serializer and deserializer. 


im happy about any kind of suggestions or tipps! 


Hi Joel!

Maybe the example called CommunicationClient_Test would be a good start. It uses the class ObjectState to do the serialization (in general). It uses the functionalities provided by ObjectStateJSONConversion.hpp.

And if you need more examples for that, you can also check out:

  1. which uses also ObjectState to create additional JSON interfaces like in the example Add-On and
  2. which builds even further on top of that.


I also suspect that going from ObjectState <-> JSON to ObjectState <-> Binary later would be an option, since there are already functions for this as well.


Hope that helps,


Bernd Schwarzenbacher - Archicad Add-On Developer - Get Add-Ons & Archicad Tips on my Website:

Very Cool! Thank you very much! 

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!