<?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: Open and activate new family document from standard template in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/open-and-activate-new-family-document-from-standard-template/m-p/12896840#M4188</link>
    <description>&lt;P&gt;Thanks again, I don't know how that happened. I've &lt;A href="https://forums.autodesk.com/t5/revit-ideas/openandactivatedocument-for-family-template/idi-p/12896835" target="_blank" rel="noopener"&gt;reposted it to the ideas&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I couldn't find a way to delete it, but left a note and hopefully some admin will remove it.&lt;/P&gt;</description>
    <pubDate>Sun, 14 Jul 2024 17:07:14 GMT</pubDate>
    <dc:creator>DanielKP2Z9V</dc:creator>
    <dc:date>2024-07-14T17:07:14Z</dc:date>
    <item>
      <title>Open and activate new family document from standard template</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/open-and-activate-new-family-document-from-standard-template/m-p/12895840#M4182</link>
      <description>&lt;P&gt;Code below doesn't open and activate new family from the standard template despite working fine with .rfa or .rvt files. OpenAndActivateDocument returns null.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;using Autodesk.Revit.UI;
using Autodesk.Revit.DB;

public class CreateAndActivateNewFamily : IExternalCommand
{
    public Result Execute(
        ExternalCommandData commandData, 
        ref string message, 
        ElementSet elements)
    {
        UIApplication uiapp = commandData.Application;

        // Define the path to the family template
        string familyTemplatePath = @"C:\ProgramData\Autodesk\RVT 2024\Family Templates\English\Metric Detail Item.rft";

        // Open and activate the new family document
        UIDocument uidoc = uiapp.OpenAndActivateDocument(familyTemplatePath);
        

        return Result.Succeeded;
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jul 2024 11:42:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/open-and-activate-new-family-document-from-standard-template/m-p/12895840#M4182</guid>
      <dc:creator>DanielKP2Z9V</dc:creator>
      <dc:date>2024-07-14T11:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: Open and activate new family document from standard template</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/open-and-activate-new-family-document-from-standard-template/m-p/12896257#M4183</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14971581"&gt;@DanielKP2Z9V&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;A href="https://www.revitapidocs.com/2022/3b3d671d-47ec-2ed8-1818-a7c19d01884b.htm" target="_blank" rel="noopener"&gt;OpenAndActivateDocument Method (String)&lt;/A&gt;&amp;nbsp;method supports only Revit Project, Project Template and Family Document. &lt;STRONG&gt;Family Templates are not supported in this method&lt;/STRONG&gt;.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Workaround:&amp;nbsp;&lt;/STRONG&gt;you can save as the Revit Family Template and Open and Active the Family Document.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Workaround Code Snippet&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;String conceptualmassTemplatePath = famTemplatePath + @"\Conceptual Mass\Mass.rft";
           if (System.IO.File.Exists(conceptualmassTemplatePath))
           {
              //Family Template Not Supported
              //uiApp.OpenAndActivateDocument(conceptualmassTemplatePath); 
              Document familyDocument = uiApp.Application.NewFamilyDocument(conceptualmassTemplatePath);
              if (null == familyDocument)
              {
                 throw new Exception("Cannot open family document");
              }

              String fileName = Guid.NewGuid().ToString() + ".rfa";
              familyDocument.SaveAs(fileName);
              familyDocument.Close();

              uiApp.OpenAndActivateDocument(fileName);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this will Helps &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jul 2024 03:46:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/open-and-activate-new-family-document-from-standard-template/m-p/12896257#M4183</guid>
      <dc:creator>Mohamed_Arshad</dc:creator>
      <dc:date>2024-07-14T03:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: Open and activate new family document from standard template</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/open-and-activate-new-family-document-from-standard-template/m-p/12896602#M4184</link>
      <description>&lt;P&gt;Really? Documention of the &lt;A href="https://www.revitapidocs.com/2022/3b3d671d-47ec-2ed8-1818-a7c19d01884b.htm" target="_blank" rel="noopener"&gt;OpenAndActivateDocument Method&lt;/A&gt; says that "&lt;SPAN&gt;The file can be either a Revit project, template, or family document&lt;/SPAN&gt;".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried the workaround you proposed, but it caused Revit to hang for half a minute, while normally the template opens almost immediately.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This doesn't seem fair.&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jul 2024 11:40:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/open-and-activate-new-family-document-from-standard-template/m-p/12896602#M4184</guid>
      <dc:creator>DanielKP2Z9V</dc:creator>
      <dc:date>2024-07-14T11:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: Open and activate new family document from standard template</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/open-and-activate-new-family-document-from-standard-template/m-p/12896698#M4185</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14971581"&gt;@DanielKP2Z9V&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Yes, as you say it cause a minute hang, because it is doing 2 processes, or you can propose Idea in Autodesk forum. So that we can get a solution for this &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jul 2024 14:02:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/open-and-activate-new-family-document-from-standard-template/m-p/12896698#M4185</guid>
      <dc:creator>Mohamed_Arshad</dc:creator>
      <dc:date>2024-07-14T14:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: Open and activate new family document from standard template</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/open-and-activate-new-family-document-from-standard-template/m-p/12896763#M4186</link>
      <description>&lt;P&gt;You are right, I've &lt;A href="https://forums.autodesk.com/t5/revit-api-forum/openandactivatedocument-for-family-template/td-p/12896759" target="_blank" rel="noopener"&gt;submitted it&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By the way, do you know if the same thing could be automated in GUI in some way as opposed to going through Revit API? In other words, are you aware of any more or less reliable method to invoke &lt;A href="https://pastebin.com/U1Gh7tWV" target="_blank" rel="noopener"&gt;newfamily command&lt;/A&gt; and then also choose Detail item file in the next dialog? I know this is off-topic, but if you know something like that, it might help me a lot in bridging such limitations in the API. I suppose this wouldn't be even Revit, but more Windows-specific method then?&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jul 2024 15:32:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/open-and-activate-new-family-document-from-standard-template/m-p/12896763#M4186</guid>
      <dc:creator>DanielKP2Z9V</dc:creator>
      <dc:date>2024-07-14T15:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: Open and activate new family document from standard template</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/open-and-activate-new-family-document-from-standard-template/m-p/12896810#M4187</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14971581"&gt;@DanielKP2Z9V&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;You raised a Question in Forum that is good, better to raise a Idea in Autodesk Ideas.&amp;nbsp;&lt;A href="https://forums.autodesk.com/t5/revit-ideas/idb-p/302" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/revit-ideas/idb-p/302&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jul 2024 16:38:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/open-and-activate-new-family-document-from-standard-template/m-p/12896810#M4187</guid>
      <dc:creator>Mohamed_Arshad</dc:creator>
      <dc:date>2024-07-14T16:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: Open and activate new family document from standard template</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/open-and-activate-new-family-document-from-standard-template/m-p/12896840#M4188</link>
      <description>&lt;P&gt;Thanks again, I don't know how that happened. I've &lt;A href="https://forums.autodesk.com/t5/revit-ideas/openandactivatedocument-for-family-template/idi-p/12896835" target="_blank" rel="noopener"&gt;reposted it to the ideas&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I couldn't find a way to delete it, but left a note and hopefully some admin will remove it.&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jul 2024 17:07:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/open-and-activate-new-family-document-from-standard-template/m-p/12896840#M4188</guid>
      <dc:creator>DanielKP2Z9V</dc:creator>
      <dc:date>2024-07-14T17:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: Open and activate new family document from standard template</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/open-and-activate-new-family-document-from-standard-template/m-p/12896851#M4189</link>
      <description>&lt;P&gt;No Worries, if someone know any other workaround they will answer on it, let it be there&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jul 2024 17:19:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/open-and-activate-new-family-document-from-standard-template/m-p/12896851#M4189</guid>
      <dc:creator>Mohamed_Arshad</dc:creator>
      <dc:date>2024-07-14T17:19:41Z</dc:date>
    </item>
    <item>
      <title>Re: Open and activate new family document from standard template</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/open-and-activate-new-family-document-from-standard-template/m-p/13191832#M4190</link>
      <description>&lt;P&gt;I'd also like the family template option to work. The save as work around is clunky and takes too long. Hopefully Autodesk makes it available soon. Seems logical&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2024 07:37:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/open-and-activate-new-family-document-from-standard-template/m-p/13191832#M4190</guid>
      <dc:creator>chas.barrott</dc:creator>
      <dc:date>2024-12-04T07:37:56Z</dc:date>
    </item>
  </channel>
</rss>

