<?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: FilledRegion.GetBoundaries() API bug? in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/filledregion-getboundaries-api-bug/m-p/8912442#M41032</link>
    <description>&lt;P&gt;Figured this out already.&lt;/P&gt;&lt;P&gt;Just needed to wrap this in another "Transaction" and now it works as expected.&lt;/P&gt;&lt;P&gt;Hope this helps others that may get thrown off for a moment like I did.&lt;/P&gt;</description>
    <pubDate>Tue, 16 Jul 2019 16:59:13 GMT</pubDate>
    <dc:creator>AlbertoRosario</dc:creator>
    <dc:date>2019-07-16T16:59:13Z</dc:date>
    <item>
      <title>FilledRegion.GetBoundaries() API bug?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/filledregion-getboundaries-api-bug/m-p/8910883#M41031</link>
      <description>&lt;P&gt;For Revit 2016 through 2018.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Shouldn't &lt;EM&gt;&lt;STRONG&gt;frDayZone.GetBoundaries()&lt;/STRONG&gt;&lt;/EM&gt; have the same "&lt;EM&gt;Count&lt;/EM&gt;" quantity as &lt;STRONG&gt;&lt;EM&gt;boundaryprofile&lt;/EM&gt;&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;Here's the problem code:&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Note &amp;quot;Count=0&amp;quot; for iCurveLoopTwo" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/657815i4672C97C71BBB0BD/image-size/large?v=v2&amp;amp;px=999" role="button" title="20190715-API-Bug-FilledRegion_GetBoundaries-01.PNG" alt="Note &amp;quot;Count=0&amp;quot; for iCurveLoopTwo" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Note "Count=0" for iCurveLoopTwo&lt;/span&gt;&lt;/span&gt;&amp;nbsp;So, creating a Solid fails with line written like:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;Solid fSolid = GeometryCreationUtilities.CreateExtrusionGeometry(frDayZOne.GetBoundaries(), XYZ.BasisZ, 100000);&lt;/P&gt;&lt;P&gt;Obviously because of an unforeseen problem with the .GetBoundaries() FilledRegion method returning a "Count" of zero.&lt;/P&gt;&lt;P&gt;When attempting to create said Solid with an empty IList&amp;lt;Curveloop&amp;gt; gives error message:&lt;/P&gt;&lt;P&gt;"Input array of CurveLoops is empty. Parameter name: profileLoops"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yet, &lt;EM&gt;&lt;STRONG&gt;frDayZone.GetBoundaries()&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp; returns the expected "Count" successfully creates a Solid and executes all the command code, &lt;STRONG&gt;JUST on the FIRST run oddly enough&lt;/STRONG&gt;, right after a System.Forms.OpenDialog box is used to load a tag into the document.&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="This only works first time loading the Tag via System.Windows.Forms.OpenFileDialog" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/657824i67821B577B4A21DE/image-size/large?v=v2&amp;amp;px=999" role="button" title="20190715-API-Bug-FilledRegion_GetBoundaries-01b.PNG" alt="This only works first time loading the Tag via System.Windows.Forms.OpenFileDialog" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;This only works first time loading the Tag via System.Windows.Forms.OpenFileDialog&lt;/span&gt;&lt;/span&gt;If the command is run again the error with FilledRegion.GetBoundaries() "Count = 0" will occur.&lt;/P&gt;&lt;P&gt;Also, if the command has never been run and the tag already exists in the document, the error occurs.&lt;/P&gt;&lt;P&gt;To repeat, the main question is:&lt;/P&gt;&lt;P&gt;Why is&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;rDayZone.GetBoundaries()&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;returning "&lt;STRONG&gt;&lt;EM&gt;Count = 0&lt;/EM&gt;&lt;/STRONG&gt;" instead of"&lt;EM&gt;Count=1&lt;/EM&gt;" like&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;boundaryprofile&lt;/EM&gt;&lt;/STRONG&gt;?&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2019 01:18:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/filledregion-getboundaries-api-bug/m-p/8910883#M41031</guid>
      <dc:creator>AlbertoRosario</dc:creator>
      <dc:date>2019-07-16T01:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: FilledRegion.GetBoundaries() API bug?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/filledregion-getboundaries-api-bug/m-p/8912442#M41032</link>
      <description>&lt;P&gt;Figured this out already.&lt;/P&gt;&lt;P&gt;Just needed to wrap this in another "Transaction" and now it works as expected.&lt;/P&gt;&lt;P&gt;Hope this helps others that may get thrown off for a moment like I did.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2019 16:59:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/filledregion-getboundaries-api-bug/m-p/8912442#M41032</guid>
      <dc:creator>AlbertoRosario</dc:creator>
      <dc:date>2019-07-16T16:59:13Z</dc:date>
    </item>
  </channel>
</rss>

