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

Custom "Save As" dialog box

Anonymous
Not applicable
Hi,

I'm looking to create an add-on that allows for easy file naming using a naming standard. I was wondering if it is possible to either inject a button or tickbox into the standard Archicad Save As interface to automatically name files? The data for the name would be pulled from within the project itself.

If not, is it possible to create my own custom Save As dialog to allow for this feature?

Cheers.
7 REPLIES 7
Ralph Wessel
Mentor
What kind of files are you planning to target? The main project or files exported from it?

And do you want to prevent the user from setting or modifying the name?
Ralph Wessel BArch
Anonymous
Not applicable
Ralph wrote:
What kind of files are you planning to target? The main project or files exported from it?

I'm looking to save the PLN model file.
Ralph wrote:
And do you want to prevent the user from setting or modifying the name?

The user should get a suggestion based on a set of criteria, but an override should be available.

Thanks for the response.

EDIT: Just to confirm my own research, is it possible to implement my own elements into standard ArchiCAD interface boxes?
Tibor Lorantfy
Graphisoft Alumni
Graphisoft Alumni
rCushing wrote:
EDIT: Just to confirm my own research, is it possible to implement my own elements into standard ArchiCAD interface boxes?
You have possibility to add user interface components integrated into the standard ARCHICAD dialogs to handle your custom element and attribute data.
You can append your additional panels into the
  • element settings dialogs
  • attribute settings dialogs
  • info box
You can append a new custom file format to the standard Save As dialog, but currently it's not possible to extend the Save As dialog with new controls.
After the user selected your registered custom file format and clicked to Save, you can invoke any dialog before the saving process, there you can ask the user to select the saving options.

Of course you can create your own custom Save As dialog also, with any additional buttons, tickboxes etc.
For example if you implement a new menu item, you can open your own Save As dialog after the user selected your menu item.
Anonymous
Not applicable
Tibor wrote:
After the user selected your registered custom file format and clicked to Save, you can invoke any dialog before the saving process, there you can ask the user to select the saving options.

Can you give an example as to how to invoke a dialog during saving? I'm unsure of how to do this, so any help would be gratefully received. Thanks for the suggestion.
Ralph Wessel
Mentor
rCushing wrote:
Can you give an example as to how to invoke a dialog during saving? I'm unsure of how to do this, so any help would be gratefully received. Thanks for the suggestion.
Take a look at DG::FileDialog, e.g.:

	DG::FileDialog dialog(DG::FileDialog::Save);
	dialog.SetTitle(dialogTitle);
	dialog.Invoke();
It has options for setting the starting location for the file navigator, setting the possible saved file types and extracting the location specified by the user.
Ralph Wessel BArch
Akos Somorjai
Graphisoft
Graphisoft
Ralph wrote:
rCushing wrote:
Can you give an example as to how to invoke a dialog during saving? I'm unsure of how to do this, so any help would be gratefully received. Thanks for the suggestion.
Take a look at DG::FileDialog, e.g.:

	DG::FileDialog dialog(DG::FileDialog::Save);
	dialog.SetTitle(dialogTitle);
	dialog.Invoke();
It has options for setting the starting location for the file navigator, setting the possible saved file types and extracting the location specified by the user.
Thanks, Ralph!

Though this won't allow him to save to any other format than his own.

Best, Akos
Ralph Wessel
Mentor
Thanks Ákos. I assumed that DG::FileDialog could be used to obtain the required location and the project saved to that location with ACAPI_Automate(APIDo_SaveID).
Ralph Wessel BArch