<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic [SOLVED] Is there File chooser dialog class or method in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-Is-there-File-chooser-dialog-class-or-method/m-p/291547#M4862</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;Hi there&lt;BR /&gt;&lt;BR /&gt;I would like to know is there a class or method to open file chooser dialog ?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance!&lt;/DIV&gt;</description>
    <pubDate>Thu, 13 Jul 2023 13:43:12 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-07-13T13:43:12Z</dc:date>
    <item>
      <title>[SOLVED] Is there File chooser dialog class or method</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-Is-there-File-chooser-dialog-class-or-method/m-p/291547#M4862</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hi there&lt;BR /&gt;&lt;BR /&gt;I would like to know is there a class or method to open file chooser dialog ?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance!&lt;/DIV&gt;</description>
      <pubDate>Thu, 13 Jul 2023 13:43:12 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-Is-there-File-chooser-dialog-class-or-method/m-p/291547#M4862</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-07-13T13:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: Is there File chooser dialog class or method</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-Is-there-File-chooser-dialog-class-or-method/m-p/291548#M4863</link>
      <description>Hi, &lt;BR /&gt;
 &lt;BR /&gt;
Yes, you can use DG::FileDialog for opening or saving files. &lt;BR /&gt;
Here is an example code for you (copied from Communication_Manager example Add-On): 
&lt;PRE&gt;static bool	GetOpenFile (IO::Location*	dloc, const char* fileExtensions, const GS::UniString&amp;amp; filterText) 
{ 
	FTM::TypeID	retID; 
	FTM::FileTypeManager	ftman ("MyManager"); 
	FTM::FileType			type (NULL, 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);	// Force it on mac... 
	dlg.SetFilterText (i, filterText); 
 
	if (dlg.Invoke ()) { 
		*dloc = dlg.GetSelectedFile (); 
		return (true); 
	} else 
		return (false); 
} 
 
// ----------------------------------------------------------------------------- 
 
// Using: 
	IO::Location dwgFileLoc; 
	if (!GetOpenFile (&amp;amp;dwgFileLoc, "dwg", "*.dwg")) 
		return; 
 
	IO::Name	dwgName; 
	dwgFileLoc.GetLastLocalName (&amp;amp;dwgName);&lt;/PRE&gt; &lt;BR /&gt;
Note that the type of the FileDialog could be the followings: (see in DGFileDialog.hpp) 
&lt;PRE&gt;	enum Type { 
		OpenFile, 
		OpenMultiFile, 
		OpenFolder, 
		OpenMultiFolder, 
		Save 
	};&lt;/PRE&gt; &lt;BR /&gt;
Regards, &lt;BR /&gt;
Tibor</description>
      <pubDate>Mon, 17 Aug 2015 10:51:00 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-Is-there-File-chooser-dialog-class-or-method/m-p/291548#M4863</guid>
      <dc:creator>Tibor Lorantfy</dc:creator>
      <dc:date>2015-08-17T10:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: Is there File chooser dialog class or method</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-Is-there-File-chooser-dialog-class-or-method/m-p/291549#M4864</link>
      <description>Hi.&lt;BR /&gt;
&lt;BR /&gt;
Thank you for the quick response.</description>
      <pubDate>Mon, 17 Aug 2015 11:51:02 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/SOLVED-Is-there-File-chooser-dialog-class-or-method/m-p/291549#M4864</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-08-17T11:51:02Z</dc:date>
    </item>
  </channel>
</rss>

