<?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 Adding Project Template to 'New Project' via API in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/adding-project-template-to-new-project-via-api/m-p/8585348#M44308</link>
    <description>&lt;P&gt;I noticed that the UI method for adding a project template to the 'New Project' dialog on the Start Window is by going to Options-&amp;gt;File Locations and clicking the little plus symbol.&amp;nbsp; Is there any way to achieve this same effect using the API?&amp;nbsp; I would like to add templates to the dropdown.&lt;/P&gt;</description>
    <pubDate>Sun, 10 Feb 2019 04:13:53 GMT</pubDate>
    <dc:creator>mhillis</dc:creator>
    <dc:date>2019-02-10T04:13:53Z</dc:date>
    <item>
      <title>Adding Project Template to 'New Project' via API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/adding-project-template-to-new-project-via-api/m-p/8585348#M44308</link>
      <description>&lt;P&gt;I noticed that the UI method for adding a project template to the 'New Project' dialog on the Start Window is by going to Options-&amp;gt;File Locations and clicking the little plus symbol.&amp;nbsp; Is there any way to achieve this same effect using the API?&amp;nbsp; I would like to add templates to the dropdown.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Feb 2019 04:13:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/adding-project-template-to-new-project-via-api/m-p/8585348#M44308</guid>
      <dc:creator>mhillis</dc:creator>
      <dc:date>2019-02-10T04:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Project Template to 'New Project' via API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/adding-project-template-to-new-project-via-api/m-p/8586567#M44309</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Dear Michael,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you for your query.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I asked the development team for you.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Jeremy&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Feb 2019 06:48:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/adding-project-template-to-new-project-via-api/m-p/8586567#M44309</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2019-02-11T06:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Project Template to 'New Project' via API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/adding-project-template-to-new-project-via-api/m-p/8587186#M44310</link>
      <description>&lt;P&gt;You can do it by editing the C:\Users\%username%\AppData\Roaming\Autodesk\Revit\Autodesk Revit 2019\Revit.ini file with standard .NET functions.&lt;/P&gt;
&lt;P&gt;Section&amp;nbsp;[DirectoriesENU] --&amp;gt; DefaultTemplate&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;string oriDatei = @"" + Environment.GetEnvironmentVariable("appdata") + @"\Autodesk\Revit\Autodesk Revit 2019\Revit.ini";
            string tmpDatei = @"c:\temp\11.ini";

            if (System.IO.File.Exists(oriDatei))
            {
                using (StreamReader sr = new StreamReader(oriDatei, Encoding.Unicode))
                {
                    StreamWriter sw = new StreamWriter(tmpDatei, false, Encoding.Unicode);
                    string inputLine = "";

                    while ((inputLine = sr.ReadLine()) != null)
                    {
                        if (inputLine.StartsWith("DefaultTemplate="))
                        {
                            if (inputLine.Contains("Example_SCHEMA.rte"))
                            {
                               // do nothing
                            }
                            else
                            {
                                inputLine = inputLine + @", Example_SCHEMA=C:\temp\Example_SCHEMA.rte";
                            }
                        }
                        sw.WriteLine(inputLine);
                    }
                    sw.Close();                                     
                }

                System.IO.File.Replace(tmpDatei, oriDatei, null); 
            }&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Feb 2019 12:49:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/adding-project-template-to-new-project-via-api/m-p/8587186#M44310</guid>
      <dc:creator>pgerz</dc:creator>
      <dc:date>2019-02-11T12:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Project Template to 'New Project' via API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/adding-project-template-to-new-project-via-api/m-p/8590218#M44311</link>
      <description>&lt;P&gt;Dear Peter,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for the cool and simple solution.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I added it to the blog to preserve it for posterity:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2019/02/accessing-useful-settings-in-the-ini-file.html" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2019/02/accessing-useful-settings-in-the-ini-file.html&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2019 14:53:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/adding-project-template-to-new-project-via-api/m-p/8590218#M44311</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2019-02-12T14:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Project Template to 'New Project' via API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/adding-project-template-to-new-project-via-api/m-p/9312453#M44312</link>
      <description>&lt;P&gt;Also, just discovered, -&amp;nbsp;Autodesk.Revit.ApplicationServices.Application.CurrentUsersDataFolderPath returns the path where revit.ini is located.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 10:26:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/adding-project-template-to-new-project-via-api/m-p/9312453#M44312</guid>
      <dc:creator>cig_ad</dc:creator>
      <dc:date>2020-02-12T10:26:54Z</dc:date>
    </item>
  </channel>
</rss>

