<?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 Re: Create FileSaveDialog Box in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/create-filesavedialog-box/m-p/11351174#M17562</link>
    <description>&lt;P&gt;Sorry, I do not understand what your problem is. I thought that you wanted to specify the full file path when initialising the form and before displaying it to the user. Apparently, you have some other need. What is it? Please describe it as a black box. What input do you have? What is the desired output? What is the desired side effect?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 10 Aug 2022 13:20:17 GMT</pubDate>
    <dc:creator>jeremy_tammik</dc:creator>
    <dc:date>2022-08-10T13:20:17Z</dc:date>
    <item>
      <title>Create FileSaveDialog Box</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-filesavedialog-box/m-p/11349987#M17558</link>
      <description>&lt;P&gt;Seemingly simple question, but I had no luck searching around for the answer. I am trying to set the file path for an image I am exporting using C# in VisualStudio to create an .addin to use in Revit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Autodesk.Revit.ApplicationServices;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using Autodesk.Revit.UI.Selection;
using Autodesk.Revit.DB.Architecture;

//We will not be committing any changes to the model, so read only for the transaction mode.
[Transaction(TransactionMode.ReadOnly)]
public class Main : IExternalCommand
{
    public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
    {
        //Get application and document objects
        UIApplication uiapp = commandData.Application;
        Document doc = uiapp.ActiveUIDocument.Document;
     

        //
        ImageExportOptions imgExportOpts = new ImageExportOptions();
        {
            imgExportOpts.ZoomType = ZoomFitType.FitToPage;
            imgExportOpts.PixelSize = 500;
            imgExportOpts.FilePath = "C:/Users/username/Documents/Test.TIFF";
            imgExportOpts.FitDirection = FitDirectionType.Vertical;
            imgExportOpts.HLRandWFViewsFileType = ImageFileType.TIFF;
            imgExportOpts.ShadowViewsFileType = ImageFileType.TIFF;
            imgExportOpts.ImageResolution = ImageResolution.DPI_72;
            imgExportOpts.ShouldCreateWebSite = false;
        };

        doc.ExportImage(imgExportOpts);

        //Returns success if programs runs well
        return Result.Succeeded;
    }
     
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am thinking of adding:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;        //Setting export path        
        string filePath;
        public Return FileSaveDialog()
        {
            filePath = ...   
            return filePath
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;somewhere after I define doc as a type of class Document. As you can tell I am not really sure what I am doing here. I tried looking at other examples and the revitapi help document, to no avail. I would be really grateful for any assistance. I am not sure if I should be doing something more like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;FileSaveDialog fileSaveDialog = new FileSaveDialog(string);
{
Stuff inside here;
}&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 09 Aug 2022 22:02:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-filesavedialog-box/m-p/11349987#M17558</guid>
      <dc:creator>Iev60047</dc:creator>
      <dc:date>2022-08-09T22:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: Create FileSaveDialog Box</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-filesavedialog-box/m-p/11350473#M17559</link>
      <description>&lt;P&gt;&lt;A href="https://duckduckgo.com/?q=FileSaveDialog+set+path&amp;amp;atb=v314-1&amp;amp;ia=web" target="_blank"&gt;https://duckduckgo.com/?q=FileSaveDialog+set+path&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 06:07:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-filesavedialog-box/m-p/11350473#M17559</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2022-08-10T06:07:54Z</dc:date>
    </item>
    <item>
      <title>Re: Create FileSaveDialog Box</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-filesavedialog-box/m-p/11351086#M17560</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/824630"&gt;@jeremy_tammik&lt;/a&gt;&amp;nbsp;I am trying my best here. Went through the internet search you provided, but it seems more aimed at actually&amp;nbsp;&lt;STRONG&gt;saving&lt;/STRONG&gt; a file. I am just trying to specify a file path. I do not need file output with the dialog.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;        public string textBox1 = null;
    private void SaveButton_Click(object sender, EventArgs e)
        {
            FileSaveDialog saveFileDialog1 = new FileSaveDialog();
            saveFileDialog1.InitialDirectory = @ "C:\";      
            saveFileDialog1.Title = "Select path for image export";
            saveFileDialog1.CheckFileExists = true;
            saveFileDialog1.CheckPathExists = true;
            saveFileDialog1.DefaultExt = "TIFF";
            saveFileDialog1.Filter = "TIFF files (*.TIFF)|*.TIFF|All files (*.*)|*.*";
            saveFileDialog1.FilterIndex = 2;
            saveFileDialog1.RestoreDirectory = true;
            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                textBox1.Text = saveFileDialog1.FilePath;
            }
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried modifying a snippet I found, but to no avail.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 12:46:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-filesavedialog-box/m-p/11351086#M17560</guid>
      <dc:creator>Iev60047</dc:creator>
      <dc:date>2022-08-10T12:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: Create FileSaveDialog Box</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-filesavedialog-box/m-p/11351166#M17561</link>
      <description>&lt;P&gt;Just specify this path as a variable and you can use it anywhere&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var imagePath = @"C:\Users\username\Desktop\Test.tif";
var options = new ImageExportOptions
{
    ExportRange = ExportRange.CurrentView,
    ZoomType = ZoomFitType.FitToPage,
    PixelSize = 500,
    FilePath = imagePath,
    FitDirection = FitDirectionType.Vertical,
    HLRandWFViewsFileType = ImageFileType.TIFF,
    ShadowViewsFileType = ImageFileType.TIFF,
    ImageResolution = ImageResolution.DPI_72,
    ShouldCreateWebSite = false,
};

doc.ExportImage(options);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 10 Aug 2022 13:17:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-filesavedialog-box/m-p/11351166#M17561</guid>
      <dc:creator>nice3point</dc:creator>
      <dc:date>2022-08-10T13:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: Create FileSaveDialog Box</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-filesavedialog-box/m-p/11351174#M17562</link>
      <description>&lt;P&gt;Sorry, I do not understand what your problem is. I thought that you wanted to specify the full file path when initialising the form and before displaying it to the user. Apparently, you have some other need. What is it? Please describe it as a black box. What input do you have? What is the desired output? What is the desired side effect?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 13:20:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-filesavedialog-box/m-p/11351174#M17562</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2022-08-10T13:20:17Z</dc:date>
    </item>
    <item>
      <title>Re: Create FileSaveDialog Box</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-filesavedialog-box/m-p/11351188#M17563</link>
      <description>&lt;P&gt;Again thank you for&amp;nbsp; your help! Input is selection of folder through what I suppose is the FileSaveDialog. This selection of the folder will complete the call and return a value (the name of the folder, i.e. the desired file path) to a variable I have previously defined. I will then use this variable in the export method.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 13:25:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-filesavedialog-box/m-p/11351188#M17563</guid>
      <dc:creator>Iev60047</dc:creator>
      <dc:date>2022-08-10T13:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: Create FileSaveDialog Box</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-filesavedialog-box/m-p/11352310#M17564</link>
      <description>&lt;P&gt;I'd recommend using the .NET &lt;A href="https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.savefiledialog?view=netframework-4.8" target="_blank" rel="noopener"&gt;SaveFileDialog&lt;/A&gt; instead of Revit's FileSaveDialog. The minimum you need to do is call the dialog's ShowFile method then put the value of its FileName property into your filePath variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.filedialog?view=netframework-4.8#examples" target="_blank" rel="noopener"&gt;This example&lt;/A&gt;, although it uses the OpenFileDialog, shows how to get the selected file name.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 21:37:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-filesavedialog-box/m-p/11352310#M17564</guid>
      <dc:creator>mhannonQ65N2</dc:creator>
      <dc:date>2022-08-10T21:37:45Z</dc:date>
    </item>
  </channel>
</rss>

