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

Inserting file types into DG::FileDialog::Save

Anonymous
Not applicable
Hi,

I'm trying to insert file types into the selector at the bottom of the save dialog, but as far as I can tell I need the ID number for each file type? Here's what I've got so far:
FTM::GeneralID png;
png.Load(5);
UIndex i = dialog.AddFilter(png);
dialog.SetFilterText(i, ".png");

It seems if I want to add more I need to know the exact ID for each file type. Is there a list anywhere or am I approaching this in the completely wrong way?

Cheers
3 REPLIES 3
Ralph Wessel
Mentor
Take a look at the Communication Manager example project with the dev-kit, specifically the function GetOpenFile in Communication_Manager.cpp. It's adding a type to the 'open' dialog, but the same principle applies to saving.
Ralph Wessel BArch
Software Engineer Speckle Systems
Anonymous
Not applicable
That worked perfectly. Thanks for the help.
Anonymous
Not applicable
rCushing wrote:
That worked perfectly. Thanks for the help.
I tried changing the code in the example to work with Save dialog and it seems to work with the extension (plan) but it crashes when I click save..
Could you post your code please?