Create Foliage in C++

So i made it working but I have problems saving and further adjusting the foliage.
Say i have some datatables that i want to use to populate the foliagetool. The foliage is not saved except when i add at least one instance via the foliage tool after running the c++ code; then it is somehow marked dirty i assume and it can be saved without being discarded when loading a different level or reopening the project. But I can never access the foliage again with the foliage tool as it is invisible to it, only via code.

Any hints?

Best regards