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.

How to export model with self-defined button?

Anonymous
Not applicable
Hi,

I'd like to develop a plugin to export model with self-defined UI. I notice in the example ModelAccess_Test, it uses ACAPI_Register_FileType and can export model through the Archicad "Save As" choice. But if I add my own button in the UI, anyone knows how to export through the button I defined?
Thanks.
3 REPLIES 3
Ralph Wessel
Mentor
Yi wrote:
I'd like to develop a plugin to export model with self-defined UI. I notice in the example ModelAccess_Test, it uses ACAPI_Register_FileType and can export model through the Archicad "Save As" choice. But if I add my own button in the UI, anyone knows how to export through the button I defined?
Use DG::FileDialog. Take a look at the Markup_Test example project, specifically the method MarkUpTest::ExportToBCF
Ralph Wessel BArch
Software Engineer Speckle Systems
Anonymous
Not applicable
Ralph wrote:
Yi wrote:
I'd like to develop a plugin to export model with self-defined UI. I notice in the example ModelAccess_Test, it uses ACAPI_Register_FileType and can export model through the Archicad "Save As" choice. But if I add my own button in the UI, anyone knows how to export through the button I defined?
Use DG::FileDialog. Take a look at the Markup_Test example project, specifically the method MarkUpTest::ExportToBCF
Hi, thank you for your reply. I checked the example of Markup_Test, and seems it deals with BCF file. Maybe I didn't explain well in my question, I want to export the model 3d info like polygons. I'm using ModelerAPI to get the 3d info, but how to export the polygons with a self-defined button instead of using "Save As"?
Ralph Wessel
Mentor
Yi wrote:
Hi, thank you for your reply. I checked the example of Markup_Test, and seems it deals with BCF file. Maybe I didn't explain well in my question, I want to export the model 3d info like polygons. I'm using ModelerAPI to get the 3d info, but how to export the polygons with a self-defined button instead of using "Save As"?
DG::FileDialog will allow you to prompt the user to specify the name and location of the file your data should be exported to. Once you have that, you can write data in many ways, e.g. IO::File::WriteBin. How you write the data depends on the structure/content of the data - is it binary? XML? Is there a 3rd-party API for structuring content? No one can tell you how to write the data without know something about it.
Ralph Wessel BArch
Software Engineer Speckle Systems