We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2017-05-11 04:00 PM - last edited on 2023-07-12 08:47 PM by Doreena Deng
2017-05-12 05:48 PM
static bool GetOpenFile (IO::Location* dloc, const char* fileExtensions, const GS::UniString& filterText) { if (dloc == nullptr) return false; FTM::TypeID retID; FTM::FileTypeManager ftman ("MyManager"); FTM::FileType type (nullptr, fileExtensions, 0, 0, 0); FTM::TypeID id = FTM::FileTypeManager::SearchForType (type); if (id == FTM::UnknownType) id = ftman.AddType (type); DG::FileDialog dlg (DG::FileDialog::OpenFile); // Open only 1 file UIndex i = dlg.AddFilter (id, DG::FileDialog::DisplayExtensions); dlg.SetFilterText (i, filterText); if (!dlg.Invoke ()) return false; *dloc = dlg.GetSelectedFile (); return true; } // ----------------------------------------------------------------------------- // Usage: IO::Location selectedTextFileLoc; if (!GetOpenFile (&selectedTextFileLoc, "Text File", "*.txt")) return;
2017-05-15 10:02 AM
2017-05-15 11:41 AM
2017-05-18 11:40 AM
jcimentarov wrote:Well, depends on where you want to see the log, I would recommend using a simple DBPrintf () call, which writes to the system.log in Console.
I have another question and I don't want to open a new thread for it. For debugging purposes I want to log some data. I'm opening the report window from File > Info > Session Report. Is this the right way to open it?
Also I'm using WriteReport_Alert() method, but I only get the popup, without logging the data into the report window of archicad. I am using the demo version of Archicad, so is it possible that ACAPI_WriteReport() doesn't work with the demo version of archicad and doesn't want to write to that file?
Thanks in advance, Julian
2017-05-24 10:17 AM