<?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: Add Revit Links to Project with C# in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7677889#M53417</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/11510"&gt;@Dale.Bartlett&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/413917"&gt;@jeremytammik&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess what I posted is old because I am developing that tool for Revit 2017.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I actually have another question, which I tried to solve by searching here on the forum and elsewhere but I'm so far from understanding that I don't even understand where to start so any input is very welcome:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, instead of hardcoding the file path or the folder path where all the files are, I'm trying to prompt the user with a file browser where he can select the files that he wants to link in the project.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've seen in another post here that&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/413917"&gt;@jeremytammik&lt;/a&gt;&amp;nbsp;suggested this class:&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-au/dotnet/api/system.windows.forms.openfiledialog?view=netframework-4.7.1" target="_blank"&gt;https://docs.microsoft.com/en-au/dotnet/api/system.windows.forms.openfiledialog?view=netframework-4.7.1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but I'm not sure it's the case here as I don't want to open any file but just retrieve the file path so I can use them in the script I already have so they can be linked in the project.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm sorry, I know it can be considered off-topic in this thread as it is sort of a different issue.&amp;nbsp;I wanted to open a new thread but I don't even know how to call it and make it relevant.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jan 2018 08:23:26 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-01-10T08:23:26Z</dc:date>
    <item>
      <title>Add Revit Links to Project with C#</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7673938#M53405</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm in my first attempt to create some custom Add-ins for Revit written in C# and the first tool I'm struggling to get working is one that takes some *.rvt files from a folder and links them in the active project.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In order to get started I simplified the functionalities of the script and right now I'm just trying to link a file that is hard coded in the script but it is still not working and I'm not too sure on the reason. I suspect it might have to do with the transaction needing to be started and/or closed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is where I got so far with my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;#region Namespaces
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Collections;
using System.Linq;
using Autodesk.Revit.ApplicationServices;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using Autodesk.Revit.UI.Selection;
using Autodesk.Revit.Creation;
#endregion

namespace LinkRVT_test
{
    [Transaction(TransactionMode.Manual)]
    public class Command : IExternalCommand
    {
        public Result Execute(
          ExternalCommandData commandData,
          ref string message,
          ElementSet elements)
        {
            // Get application and document objects

            UIApplication uiapp = commandData.Application;
            UIDocument uidoc = uiapp.ActiveUIDocument;
            Autodesk.Revit.ApplicationServices.Application app = uiapp.Application;
            Autodesk.Revit.DB.Document doc = uidoc.Document;

            try
            {
                using (Transaction transaction = new Transaction(doc))
                {
                    transaction.Start("Link files");

                    string testFile = @"C: \Users\atassera\AT\C#\Revit\LinkRVT_test\Utilities\AR-GAM-3DM-FACADE-RVT.rvt";

                    ModelPath linkpath = ModelPathUtils.ConvertUserVisiblePathToModelPath(testFile);

                    RevitLinkOptions options = new RevitLinkOptions(false);

                    RevitLinkLoadResult result = RevitLinkType.Create(doc, linkpath, options);

                    RevitLinkInstance.Create(doc, result.ElementId);
                    RevitLinkInstance instance2 = RevitLinkInstance.Create(doc, result.ElementId);
                    Location location = instance2.Location;
                    return Result.Succeeded;

                }
            }&lt;/PRE&gt;&lt;P&gt;When I start debugging, Revit opens and I go in the Add-Ins panel, External Tools and click the tool I'm creating but nothing happens.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is greatly appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Andrea&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2018 04:05:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7673938#M53405</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-09T04:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: Add Revit Links to Project with C#</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7673955#M53406</link>
      <description>&lt;P&gt;Looks to me that you are missing:&lt;/P&gt;
&lt;P&gt;transaction.Commit();&lt;/P&gt;
&lt;P&gt;before the&lt;/P&gt;
&lt;P&gt;return Result.Succeeded;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dale&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2018 04:21:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7673955#M53406</guid>
      <dc:creator>Dale.Bartlett</dc:creator>
      <dc:date>2018-01-09T04:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: Add Revit Links to Project with C#</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7673975#M53407</link>
      <description>&lt;P&gt;Thank you Dale,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your suggestion actually moved something, but the script is still not working.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now what happens is that Revit starts calculating and it says it is "Loading linked document" with the usual progress bar at the bottom left of the window bu then nothing is done and if you go in the Manage links window you see nothing has been added.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me re-copy the script below with the amendment you suggested&amp;nbsp; and another small one I just noticed:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;#region Namespaces
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Collections;
using System.Linq;
using Autodesk.Revit.ApplicationServices;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using Autodesk.Revit.UI.Selection;
using Autodesk.Revit.Creation;
#endregion

namespace LinkRVT_test
{
    [Transaction(TransactionMode.Manual)]
    public class Command : IExternalCommand
    {
        public Result Execute(
          ExternalCommandData commandData,
          ref string message,
          ElementSet elements)
        {
            // Get application and document objects

            UIApplication uiapp = commandData.Application;
            UIDocument uidoc = uiapp.ActiveUIDocument;
            Autodesk.Revit.ApplicationServices.Application app = uiapp.Application;
            Autodesk.Revit.DB.Document doc = uidoc.Document;

            try
            {
                using (Transaction transaction = new Transaction(doc))
                {
                    transaction.Start("Link files");

                    string testFile = @"C:\Users\atassera\AT\C#\Revit\LinkRVT_test\Utilities\AR-GAM-3DM-FACADE-RVT.rvt";

                    ModelPath linkpath = ModelPathUtils.ConvertUserVisiblePathToModelPath(testFile);

                    RevitLinkOptions options = new RevitLinkOptions(false);

                    RevitLinkLoadResult result = RevitLinkType.Create(doc, linkpath, options);

                    RevitLinkInstance.Create(doc, result.ElementId);
                    RevitLinkInstance instance2 = RevitLinkInstance.Create(doc, result.ElementId);
                    Location location = instance2.Location;

                    transaction.Commit();
                    return Result.Succeeded;
                }
            }&lt;/PRE&gt;&lt;P&gt;Any idea what is going on there and why at some point it just stops doing what it its supposed to do?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Andrea&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2018 04:44:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7673975#M53407</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-09T04:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: Add Revit Links to Project with C#</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7674170#M53408</link>
      <description>&lt;P&gt;Hi, your catch-finally block is missing in your code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thats maybe why your code is not running?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;So-Chong&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="try_catch_block-statement.png" style="width: 695px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/447198i18720C8A90DE8C49/image-dimensions/695x425?v=v2" width="695" height="425" role="button" title="try_catch_block-statement.png" alt="try_catch_block-statement.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2018 06:55:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7674170#M53408</guid>
      <dc:creator>so-chong</dc:creator>
      <dc:date>2018-01-09T06:55:44Z</dc:date>
    </item>
    <item>
      <title>Re: Add Revit Links to Project with C#</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7674299#M53409</link>
      <description>&lt;P&gt;A `finally` clause with nothing in it does exactly what you are specifying: nothing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2018 07:53:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7674299#M53409</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2018-01-09T07:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: Add Revit Links to Project with C#</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7674301#M53410</link>
      <description>&lt;P&gt;Why are you calling `RevitLinkInstance.Create` twice over with the exact same arguments?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That looks weird to me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2018 07:54:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7674301#M53410</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2018-01-09T07:54:01Z</dc:date>
    </item>
    <item>
      <title>Re: Add Revit Links to Project with C#</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7674396#M53411</link>
      <description>&lt;P&gt;Hi Jeremy, i totally agree with your comment &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;@Anonymous; you can remove the 'finally' clause if you don't specify what it have to do.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Interesting though, the Sharpdevelop editor gives an error without the modified code.&lt;/P&gt;&lt;P&gt;I wonder why Visual Studio(VS) is not complaining or gives an error about the try-catch clause if it was compiled succesfully in VS...or did it?&lt;/P&gt;&lt;P&gt;i have not tested in VS yet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;So-chong&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2018 08:39:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7674396#M53411</guid>
      <dc:creator>so-chong</dc:creator>
      <dc:date>2018-01-09T08:39:43Z</dc:date>
    </item>
    <item>
      <title>Re: Add Revit Links to Project with C#</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7677071#M53412</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/413917"&gt;@jeremytammik&lt;/a&gt;&amp;nbsp;, thank you for your reply!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yeah it was looking odd to me as well, but I fount it in the example code in the Revit API Docs website and I took it as it was...I guess they were probably showing three different possibilities?&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="from Revit API Doc" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/447625i8AA2F66067B05518/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="from Revit API Doc" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;from Revit API Doc&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyways, I deleted that part (latest code copied below) but it is still not working...again, it starts calculating and it gives the progress bar saying it is doing something with that file but then nothing happens. What am I doing wrong??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;#region Namespaces
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Collections;
using System.Linq;
using Autodesk.Revit.ApplicationServices;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using Autodesk.Revit.UI.Selection;
using Autodesk.Revit.Creation;
#endregion

namespace LinkRVT_test
{
    [Transaction(TransactionMode.Manual)]
    public class Command : IExternalCommand
    {
        public Result Execute(
          ExternalCommandData commandData,
          ref string message,
          ElementSet elements)
        {
            // Get application and document objects

            UIApplication uiapp = commandData.Application;
            UIDocument uidoc = uiapp.ActiveUIDocument;
            Autodesk.Revit.ApplicationServices.Application app = uiapp.Application;
            Autodesk.Revit.DB.Document doc = uidoc.Document;

            try
            {
                using (Transaction transaction = new Transaction(doc))
                {
                    transaction.Start("Link files");

                    string testFile = @"C:\Users\atassera\AT\C#\Revit\LinkRVT_test\Utilities\AR-GAM-3DM-FACADE-RVT.rvt";

                    ModelPath linkpath = ModelPathUtils.ConvertUserVisiblePathToModelPath(testFile);

                    RevitLinkOptions options = new RevitLinkOptions(false);

                    RevitLinkLoadResult result = RevitLinkType.Create(doc, linkpath, options);

                    RevitLinkInstance.Create(doc, result.ElementId);

                    transaction.Commit();
                    return Result.Succeeded;
                }
            }

            catch (Autodesk.Revit.Exceptions.OperationCanceledException)
            {
// If user decided to cancel the operation return Result.Canceled

                return Result.Cancelled;
            }

            catch (Exception ex)
            {
// If something went wrong return Result.Failed

                Console.WriteLine("There was a problem!");
                Console.WriteLine(ex.Message);
                return Result.Failed;
            }
        }
    }
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1263196"&gt;@so-chong&lt;/a&gt;&amp;nbsp;I actually have two catch clauses (more as place holders at the moment) but I thought they didn't really make a difference and I didn't copy them here as they would have made the code longer...I copied them now for clarity.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks guys, any suggestion and clarification is very well appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Andrea&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2018 22:55:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7677071#M53412</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-09T22:55:44Z</dc:date>
    </item>
    <item>
      <title>Re: Add Revit Links to Project with C#</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7677288#M53413</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just figured out that the script was not working because the file was getting corrupted for some reason while being upgraded. Sorry my bad, I guess I still need to learn a lot here both about Revit API and workflows development.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I guess the real solution was the one from&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/11510"&gt;@Dale.Bartlett&lt;/a&gt;&amp;nbsp;when he spotted I needed to "commit" the transaction. On the regards, does the "transaction.Commit();" line means something like "end the transaction"?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Andrea&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 01:25:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7677288#M53413</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-10T01:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: Add Revit Links to Project with C#</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7677472#M53414</link>
      <description>&lt;P&gt;As the name suggests, it&amp;nbsp;Commits the transaction. .Rollback does just that. A transaction is like an AutoCAD Undo group. Note there is also a TransactionGroup, which&amp;nbsp;groups transactions into one undo. Looks like it was a great learning exercise for you, well done. Dale&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 03:54:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7677472#M53414</guid>
      <dc:creator>Dale.Bartlett</dc:creator>
      <dc:date>2018-01-10T03:54:14Z</dc:date>
    </item>
    <item>
      <title>Re: Add Revit Links to Project with C#</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7677739#M53415</link>
      <description>&lt;P&gt;The sample code you show in your snapshot is from an old version of the Revit API docs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is what it lists today; one single call to Create:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H1 class="heading"&gt;Examples&lt;A name="exampleToggle" target="_blank"&gt;&lt;/A&gt;&lt;/H1&gt;
&lt;DIV id="exampleSection" class="section"&gt;
&lt;DIV class="highlight-title"&gt;&lt;SPAN class="highlight-copycode"&gt;&lt;IMG src="https://revitapidocs.s3.amazonaws.com/static/img/chm/icons/CopyCode.gif" border="0" /&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Copy&lt;/SPAN&gt;C#&lt;/DIV&gt;
&lt;DIV class="code"&gt;
&lt;PRE&gt;&lt;CODE&gt;&lt;SPAN class="highlight-keyword"&gt;public&lt;/SPAN&gt; ElementId CreateRevitLink(Document doc, &lt;SPAN class="highlight-keyword"&gt;string&lt;/SPAN&gt; pathName)
{
    FilePath path = &lt;SPAN class="highlight-keyword"&gt;new&lt;/SPAN&gt; FilePath(pathName);
    RevitLinkOptions options = &lt;SPAN class="highlight-keyword"&gt;new&lt;/SPAN&gt; RevitLinkOptions(&lt;SPAN class="highlight-keyword"&gt;false&lt;/SPAN&gt;);
    &lt;SPAN class="highlight-comment"&gt;// Create new revit link storing absolute path to a file&lt;/SPAN&gt;
    LinkLoadResult result = RevitLinkType.Create(doc, path, options);
    &lt;SPAN class="highlight-keyword"&gt;return&lt;/SPAN&gt; (result.ElementId);
}&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 10 Jan 2018 07:16:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7677739#M53415</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2018-01-10T07:16:06Z</dc:date>
    </item>
    <item>
      <title>Re: Add Revit Links to Project with C#</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7677846#M53416</link>
      <description>&lt;P&gt;For completeness, my 2017 requires:&lt;/P&gt;
&lt;PRE&gt;&lt;STRONG&gt;Revit&lt;/STRONG&gt;LinkLoadResult result = RevitLinkType.Create(doc, path, options);&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Jan 2018 08:03:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7677846#M53416</guid>
      <dc:creator>Dale.Bartlett</dc:creator>
      <dc:date>2018-01-10T08:03:25Z</dc:date>
    </item>
    <item>
      <title>Re: Add Revit Links to Project with C#</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7677889#M53417</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/11510"&gt;@Dale.Bartlett&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/413917"&gt;@jeremytammik&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess what I posted is old because I am developing that tool for Revit 2017.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I actually have another question, which I tried to solve by searching here on the forum and elsewhere but I'm so far from understanding that I don't even understand where to start so any input is very welcome:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, instead of hardcoding the file path or the folder path where all the files are, I'm trying to prompt the user with a file browser where he can select the files that he wants to link in the project.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've seen in another post here that&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/413917"&gt;@jeremytammik&lt;/a&gt;&amp;nbsp;suggested this class:&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-au/dotnet/api/system.windows.forms.openfiledialog?view=netframework-4.7.1" target="_blank"&gt;https://docs.microsoft.com/en-au/dotnet/api/system.windows.forms.openfiledialog?view=netframework-4.7.1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but I'm not sure it's the case here as I don't want to open any file but just retrieve the file path so I can use them in the script I already have so they can be linked in the project.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm sorry, I know it can be considered off-topic in this thread as it is sort of a different issue.&amp;nbsp;I wanted to open a new thread but I don't even know how to call it and make it relevant.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 08:23:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7677889#M53417</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-10T08:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: Add Revit Links to Project with C#</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7677933#M53418</link>
      <description>&lt;P&gt;Once again, you are in luck.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I implemented a BrowseDirectory utility method using the .NET FolderBrowserDialog function for my ExportCncFab add-in:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2013/12/driving-cnc-fabrication-and-shared-parameters.html" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2013/12/driving-cnc-fabrication-and-shared-parameters.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/jeremytammik/ExportCncFab" target="_blank"&gt;https://github.com/jeremytammik/ExportCncFab&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/jeremytammik/ExportCncFab/blob/master/ExportCncFab/Util.cs" target="_blank"&gt;https://github.com/jeremytammik/ExportCncFab/blob/master/ExportCncFab/Util.cs&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 08:41:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7677933#M53418</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2018-01-10T08:41:32Z</dc:date>
    </item>
    <item>
      <title>Re: Add Revit Links to Project with C#</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7680517#M53419</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/11510"&gt;@Dale.Bartlett&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;For completeness, my 2017 requires:&lt;/P&gt;
&lt;PRE&gt;&lt;STRONG&gt;Revit&lt;/STRONG&gt;LinkLoadResult result = RevitLinkType.Create(doc, path, options);&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That will change in 2018:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;The class RevitLinkLoadResult has been renamed to LinkLoadResult. Note that applications referring to RevitLinkLoadResult will need to be recompiled using the new name. The class is otherwise unchanged. The new CADLinkType reload and creation functions will return a LinkLoadResult object.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sometimes I think they rename these things just to keep us on our toes. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 22:05:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7680517#M53419</guid>
      <dc:creator>stever66</dc:creator>
      <dc:date>2018-01-10T22:05:06Z</dc:date>
    </item>
    <item>
      <title>Re: Add Revit Links to Project with C#</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7680988#M53420</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/413917"&gt;@jeremytammik&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Always great work!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I'm actually trying to do though is to get a file browser window popping up for the user to select which files he wants to link in the Revit project, rather than simply prompting him to select the folder and then getting all the files inside.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to use the OpenFileDialog class right now as I've seen it is possible to get the file paths with that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ideally I would prompt the user with a file browser (as soon as he clicks the icon of the tool), get the file paths of the files he selected and feed them in the RevitLinkInstance part.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my code, which is evidently wrong but I don't know how to fix:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;#region Namespaces
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Collections;
using System.Linq;
using System.Windows.Forms;
using Autodesk.Revit.ApplicationServices;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using Autodesk.Revit.UI.Selection;
using Autodesk.Revit.Creation;
#endregion

namespace LinkRVT_test
{
    [Transaction(TransactionMode.Manual)]
    public class Command : IExternalCommand
    {
        public Result Execute(
          ExternalCommandData commandData,
          ref string message,
          ElementSet elements)
        {
            // Get application and document objects

            UIApplication uiapp = commandData.Application;
            UIDocument uidoc = uiapp.ActiveUIDocument;
            Autodesk.Revit.ApplicationServices.Application app = uiapp.Application;
            Autodesk.Revit.DB.Document doc = uidoc.Document;

            try
            {
                using (Transaction transaction = new Transaction(doc))
                {
                    // Link files in folder

                    transaction.Start("Link files");

                    OpenFileDialog openFileDialog1 = new OpenFileDialog();
                    openFileDialog1.InitialDirectory = (@"P:\");
                    openFileDialog1.Filter = "RVT|*.rvt";
                    openFileDialog1.Multiselect = true;
                    openFileDialog1.RestoreDirectory = true;

                    if (openFileDialog1.ShowDialog() == DialogResult.OK)
                    {
                        string[] filesInFolder = openFileDialog1.FileNames;
                    }

                    foreach (string path in filesInFolder)
                    {
                        ModelPath linkpath = ModelPathUtils.ConvertUserVisiblePathToModelPath(path);
                        RevitLinkOptions options = new RevitLinkOptions(false);
                        RevitLinkLoadResult result = RevitLinkType.Create(doc, linkpath, options);
                        RevitLinkInstance.Create(doc, result.ElementId);
                    }

                    // Show summary message

                    //TaskDialog.Show("Files", filePaths.ToString());

                    // Assuming that everything went right return Result.Succeeded

                    transaction.Commit();
                    return Result.Succeeded;

                }
            }

            catch (Autodesk.Revit.Exceptions.OperationCanceledException)
            {
            // If user decided to cancel the operation return Result.Canceled

                return Result.Cancelled;
            }

            catch (Exception ex)
            {
            // If something went wrong return Result.Failed

                Console.WriteLine("There was a problem!");
                Console.WriteLine(ex.Message);
                return Result.Failed;
            }
        }&lt;/PRE&gt;&lt;P&gt;One of the problems is that&amp;nbsp;&lt;EM&gt;filesInFolder&amp;nbsp;&lt;/EM&gt;is declared in the if statement so the subsequent foreach statement can't get the values. But apart from that I believe there is some very fundamental error that I'm not getting. What am I doing wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Andrea&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2018 03:31:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7680988#M53420</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-11T03:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: Add Revit Links to Project with C#</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7681215#M53421</link>
      <description>&lt;P&gt;&lt;EM&gt;One of the problems is that&amp;nbsp;filesInFolder&amp;nbsp;is declared in the if statement so the subsequent foreach statement can't get the values.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, this will not work; declare it outside the foreach. Have you checked the contents of fileInFolder before attempting to process?&lt;/P&gt;
&lt;P&gt;foreach (string path in filesInFolder)&lt;BR /&gt;{&lt;BR /&gt;MessageBox.Show("Path = " + path);&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dale&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2018 06:57:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7681215#M53421</guid>
      <dc:creator>Dale.Bartlett</dc:creator>
      <dc:date>2018-01-11T06:57:43Z</dc:date>
    </item>
    <item>
      <title>Re: Add Revit Links to Project with C#</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7681273#M53422</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/11510"&gt;@Dale.Bartlett&lt;/a&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does it mean that I can put the line &lt;EM&gt;string[] filesInFolder = openFileDialog1.FileNames;&lt;/EM&gt; outside the&amp;nbsp;&lt;EM&gt;if (openFileDialog1.ShowDialog() == DialogResult.OK){ }&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;like this?&lt;/P&gt;&lt;PRE&gt;                    OpenFileDialog openFileDialog1 = new OpenFileDialog();
                    openFileDialog1.InitialDirectory = (@"P:\");
                    openFileDialog1.Filter = "RVT|*.rvt";
                    openFileDialog1.Multiselect = true;
                    openFileDialog1.RestoreDirectory = true;

                    string[] filesInFolder = openFileDialog1.FileNames;

                    foreach (string path in filesInFolder)
                    {
                        ModelPath linkpath = ModelPathUtils.ConvertUserVisiblePathToModelPath(path);
                        RevitLinkOptions options = new RevitLinkOptions(false);
                        RevitLinkLoadResult result = RevitLinkType.Create(doc, linkpath, options);
                        RevitLinkInstance.Create(doc, result.ElementId);
                    }&lt;/PRE&gt;&lt;P&gt;Then, I tried doing a&amp;nbsp;&lt;EM&gt;TaskDialog.Show("Files", filesInFolder.ToString()); to see&lt;/EM&gt;&amp;nbsp;if something goes in the &lt;EM&gt;filesInFolder &lt;/EM&gt;variable but the message that comes out says "System.String[] (img below). Because Revit is not prompting me with the file browser nothing goes through the array&amp;nbsp;&lt;EM&gt;filesInFolder&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="filesInFolder_empty.PNG" style="width: 533px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/448262i6B69DC3DB2BE347D/image-dimensions/533x276?v=v2" width="533" height="276" role="button" title="filesInFolder_empty.PNG" alt="filesInFolder_empty.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could it be because the whole OpenFileDialog needs to be inside a method on its own? I've seen in some examples that usually it comes in its own method (often as the event triggered by a button) as it is used as a helper for a form. What I thought for my own case is that I don't really need a form and a button that triggers the file browser to appear&amp;nbsp;as what I'm wishing to achieve is for the file browser to pop up as the first thing when you click on the icon of the tool.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS when I mention the file browser that I want to appear I mean something like this where I can select the files I want to link....just to clarify in case I'm using the wrong jargon&lt;/P&gt;&lt;P&gt;&lt;IMG src="http://i.febooti.com/images/automation-workshop/browse/browse-for-file.png" border="0" alt="Image result for file browser" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2018 07:28:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7681273#M53422</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-11T07:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: Add Revit Links to Project with C#</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7681402#M53423</link>
      <description>&lt;P&gt;Try this, bit rushed and untested, but may get you going. I can see you are really trying. Good luck.&lt;/P&gt;
&lt;PRE&gt;public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            // Get application and document objects
            UIApplication uiapp = commandData.Application;
            UIDocument uidoc = uiapp.ActiveUIDocument;
            Autodesk.Revit.ApplicationServices.Application app = uiapp.Application;
            Autodesk.Revit.DB.Document doc = uidoc.Document;

            try
            {
                using (Transaction transaction = new Transaction(doc))
                {
                    // Link files in folder
                    transaction.Start("Link files");

                    OpenFileDialog openFileDialog1 = new OpenFileDialog();
                    openFileDialog1.InitialDirectory = (@"P:\");
                    openFileDialog1.Filter = "RVT|*.rvt";
                    openFileDialog1.Multiselect = true;
                    openFileDialog1.RestoreDirectory = true;

                    if (openFileDialog1.ShowDialog() == DialogResult.OK)
                    {
                        // string[] filesInFolder = openFileDialog1.FileNames;
                        foreach (string path in openFileDialog1.FileNames)
                        {
                            FileInfo filePath = new FileInfo(path);

                            // debug ***********
                            MessageBox.Show("filePath.FullName.ToString() = " + filePath.FullName.ToString());
                            // debug ***********

                            ModelPath linkpath = ModelPathUtils.ConvertUserVisiblePathToModelPath(filePath.FullName.ToString());
                            RevitLinkOptions options = new RevitLinkOptions(false);
                            RevitLinkLoadResult result = RevitLinkType.Create(doc, linkpath, options);
                            RevitLinkInstance.Create(doc, result.ElementId);
                        }
                    }
                    // Show summary message
                    //TaskDialog.Show("Files", filePaths.ToString());
                    // Assuming that everything went right return Result.Succeeded
                    transaction.Commit();
                    return Result.Succeeded;
                }
            }
            catch (Autodesk.Revit.Exceptions.OperationCanceledException)
            {
                // If user decided to cancel the operation return Result.Canceled
                return Result.Cancelled;
            }
            catch (Exception ex)
            {
                // If something went wrong return Result.Failed
                Console.WriteLine("There was a problem!");
                Console.WriteLine(ex.Message);
                return Result.Failed;
            }
        }&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dale&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2018 08:18:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7681402#M53423</guid>
      <dc:creator>Dale.Bartlett</dc:creator>
      <dc:date>2018-01-11T08:18:36Z</dc:date>
    </item>
    <item>
      <title>Re: Add Revit Links to Project with C#</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7684445#M53424</link>
      <description>&lt;P&gt;Wow, thanks&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/11510"&gt;@Dale.Bartlett&lt;/a&gt;&amp;nbsp;, it worked perfectly!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just a couple of questions to be sure I'm getting this right:&lt;/P&gt;&lt;P&gt;1) is this line the one responsible to actually pop up the file browser?&lt;/P&gt;&lt;PRE&gt;                    if (openFileDialog1.ShowDialog() == DialogResult.OK)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) openFileDialog1 becomes sort of a variable that stores the input from the user? Otherwise where is the selection stored?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot for the help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Andrea&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 05:04:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/add-revit-links-to-project-with-c/m-p/7684445#M53424</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-12T05:04:44Z</dc:date>
    </item>
  </channel>
</rss>

