DGGetOpenFile and DGBrowseForFolder ignoring default locn
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2013-02-03
01:55 PM
- last edited on
2023-08-02
03:26 PM
by
Doreena Deng
2013-02-03
01:55 PM
Hi
I am using DGGetSaveFile to save files to an external location, and it works well. I am trying to use DGGetOpenFile to file the same files, however the defLocation parameter seems to be being ignored (it always defaults to the previous folder used). Does anyone know how to get DGGetOpenFile to successfully use the default location? DGBrowseForFolder exhibits the same problem.
Thanks in advance.
I am using DGGetSaveFile to save files to an external location, and it works well. I am trying to use DGGetOpenFile to file the same files, however the defLocation parameter seems to be being ignored (it always defaults to the previous folder used). Does anyone know how to get DGGetOpenFile to successfully use the default location? DGBrowseForFolder exhibits the same problem.
Thanks in advance.
Labels:
- Labels:
-
Add-On (C++)
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2013-02-05 11:30 AM
2013-02-05
11:30 AM
Hi paulk,
Unfortunately it's a known bug, DGGetOpenFile function ignores the default location parameter.
Until we fix it, you can use DG::FileDialog::OpenFile instead. It's totally the same. Here's a short example code for you how to use:
Tibi
Unfortunately it's a known bug, DGGetOpenFile function ignores the default location parameter.
Until we fix it, you can use DG::FileDialog::OpenFile instead. It's totally the same. Here's a short example code for you how to use:
#include "DGFileDialog.hpp" // ----------------------------------------------------------------------------- // Select a BMP file with a file dialog // ----------------------------------------------------------------------------- static bool Select_a_BMPFile (IO::Location* fileLoc) { bool reply; IO::Location defaultLocation ("C:\\myDefaultLocation"); // Instead of DGTypePopupItem use this: FTM::FileTypeManager confManager ("myConfManager"); FTM::FileType confType ("BMP File", "bmp", 0, 0, 0); FTM::TypeID confTypeID = confManager.AddType (confType); // Instead of // reply = DGGetOpenFile (defaultLocation, 1, &popup, NULL, "Select a BMP file"); // use this: DG::FileDialog dialog (DG::FileDialog::OpenFile); GS::UIndex idx = dialog.AddFilter (confTypeID); dialog.SelectFilter (idx); dialog.SetTitle ("Select a BMP file"); dialog.SetFolder (defaultLocation); reply = dialog.Invoke (); *fileLoc = dialog.GetSelectedFile (); confManager.RemoveType (confTypeID); return reply; } // Select_a_BMPFileRegards,
Tibi
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2013-02-07 06:19 AM
2013-02-07
06:19 AM
Thanks so much for that Tibi. I found the issue was external to ArchiCAD - being a Win 7 issue, so had resorted to using native Win32 dialogs, but I will implement your suggestion shortly.
Do you by chance know anything about this issue at archicad-talk.graphisoft.com/viewtopic.php?t=41441? I am trying to access element attributes from the rendering API and have not found a to do so yet.
Thanks
Do you by chance know anything about this issue at archicad-talk.graphisoft.com/viewtopic.php?t=41441? I am trying to access element attributes from the rendering API and have not found a to do so yet.
Thanks