<?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 Create window element in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/create-window-element/m-p/10948285#M20773</link>
    <description>&lt;P&gt;Hey everyone,&lt;/P&gt;&lt;P&gt;I am trying to create a new window instance using&lt;/P&gt;&lt;P&gt;doc.Create.NewFamilyInstance(XYZ, FamilySymbol, HostElement, StructuralType.NonStructural);&lt;/P&gt;&lt;P&gt;After I run the command the window is created but I can’t see it on the module.&lt;/P&gt;&lt;P&gt;I try to lock for the reason using vlookup and I suspect the reason is the new window instance&lt;/P&gt;&lt;P&gt;levelid Element properties is null,&lt;/P&gt;&lt;P&gt;host FamilyInstance properties is null,&lt;/P&gt;&lt;P&gt;host face FamilyInstance properties is null,&lt;/P&gt;&lt;P&gt;Any suggestion?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 14 Feb 2022 03:50:22 GMT</pubDate>
    <dc:creator>stav1233</dc:creator>
    <dc:date>2022-02-14T03:50:22Z</dc:date>
    <item>
      <title>Create window element</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-window-element/m-p/10948285#M20773</link>
      <description>&lt;P&gt;Hey everyone,&lt;/P&gt;&lt;P&gt;I am trying to create a new window instance using&lt;/P&gt;&lt;P&gt;doc.Create.NewFamilyInstance(XYZ, FamilySymbol, HostElement, StructuralType.NonStructural);&lt;/P&gt;&lt;P&gt;After I run the command the window is created but I can’t see it on the module.&lt;/P&gt;&lt;P&gt;I try to lock for the reason using vlookup and I suspect the reason is the new window instance&lt;/P&gt;&lt;P&gt;levelid Element properties is null,&lt;/P&gt;&lt;P&gt;host FamilyInstance properties is null,&lt;/P&gt;&lt;P&gt;host face FamilyInstance properties is null,&lt;/P&gt;&lt;P&gt;Any suggestion?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Feb 2022 03:50:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-window-element/m-p/10948285#M20773</guid>
      <dc:creator>stav1233</dc:creator>
      <dc:date>2022-02-14T03:50:22Z</dc:date>
    </item>
    <item>
      <title>Re: Create window element</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-window-element/m-p/10948758#M20774</link>
      <description>&lt;P&gt;A newly loaded family symbol needs to be activated before it can be used:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2014/08/activate-your-family-symbol-before-using-it.html" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2014/08/activate-your-family-symbol-before-using-it.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Feb 2022 10:14:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-window-element/m-p/10948758#M20774</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2022-02-14T10:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: Create window element</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-window-element/m-p/10950481#M20775</link>
      <description>&lt;P&gt;I activate the family symbol but its steal not work.&lt;/P&gt;&lt;P&gt;any more suggestion?&lt;/P&gt;</description>
      <pubDate>Tue, 15 Feb 2022 03:06:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-window-element/m-p/10950481#M20775</guid>
      <dc:creator>stav1233</dc:creator>
      <dc:date>2022-02-15T03:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: Create window element</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-window-element/m-p/10950735#M20776</link>
      <description>&lt;P&gt;Work through the process step by step in the end user interface. Does it work as expected there?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Feb 2022 06:51:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-window-element/m-p/10950735#M20776</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2022-02-15T06:51:44Z</dc:date>
    </item>
    <item>
      <title>Re: Create window element</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-window-element/m-p/10950767#M20777</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10229754"&gt;@stav1233&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;As per &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/824630"&gt;@jeremy_tammik&lt;/a&gt;&amp;nbsp;response above, I have checked and solved the same issue you have using&amp;nbsp;&lt;STRONG&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2014/08/activate-your-family-symbol-before-using-it.html" target="_blank" rel="noopener"&gt;Activate Family Symbol&amp;nbsp;&lt;/A&gt;&lt;/STRONG&gt;article.&lt;BR /&gt;Family Symbols require to be activated for them to be loaded into the document. You should check whether the symbol is active once the transaction starts or right before the transaction commits. Once it is activated the document re/generates it and it gets loaded. If the symbol is inactive, Revit gives you this exception (attached below). See my code snippet of how you can implement the solution provide on&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/824630"&gt;@jeremy_tammik&lt;/a&gt;&amp;nbsp;article.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;// Find a Window type for the new windows&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;FilteredElementCollector winCollector = new FilteredElementCollector(document);&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;IList&amp;lt;Element&amp;gt; windowTypes = winCollector.OfClass(typeof(FamilySymbol)).OfCategory(BuiltInCategory.OST_Windows).WhereElementIsElementType().ToElements();&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;FamilySymbol winType = windowTypes.First() as FamilySymbol;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;//Level level = myWall.Document.GetElement(myWall.LevelId) as Level;&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;//XYZ location = new XYZ(-22.6724094227806, 45.595454156592, 3.00196850393702);&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;double x =2 , y =2, z =2;&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;//inserts 3 windows &lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;for(int i = 0; i &amp;lt; 3; i++)&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;XYZ location = new XYZ(x, y, z);&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Transaction trans = new Transaction(document);&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;trans.Start("window instance");&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;//check whether the family symbol is active, if not activate and regenerate&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;if (!winType.IsActive)&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;winType.Activate();&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;document.Regenerate();&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;FamilyInstance instance = document.Create.NewFamilyInstance(location, winType, myWall, StructuralType.NonStructural);&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;x += 3;&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;y += 3;&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;trans.Commit();&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Feb 2022 07:14:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-window-element/m-p/10950767#M20777</guid>
      <dc:creator>caroline.gitonga</dc:creator>
      <dc:date>2022-02-15T07:14:00Z</dc:date>
    </item>
  </channel>
</rss>

