<?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: How can I flip a section using the Revit 2017 API in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-flip-a-section-using-the-revit-2017-api/m-p/6876459#M60267</link>
    <description>&lt;P&gt;Here is my testcode&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;            Document document = revit.Application.ActiveUIDocument.Document;
            Autodesk.Revit.DB.View _view2mirror = document.ActiveView;
            List&amp;lt;Element&amp;gt; _sections = new FilteredElementCollector(document)
            .OfCategory(BuiltInCategory.OST_Viewers)
            .ToList();
            Element _section = null;
            foreach (Element _e in _sections)
            {
                if (_e.Name == _view2mirror.Name &amp;amp;&amp;amp; _e.GetTypeId() == _view2mirror.GetTypeId()) _section = _e;
            }
            try
            {

                if( _section !=null)
            {
                using (Transaction t = new Transaction(document, "MirrorSection"))
                {
                    t.Start();
                    Plane _plane = Plane.CreateByNormalAndOrigin(_view2mirror.ViewDirection, _view2mirror.Origin);
                    ElementTransformUtils.MirrorElements(document, new List&amp;lt;ElementId&amp;gt; { _section.Id }, _plane, false);
                    t.Commit();
                }
            }
            return Result.Succeeded;
            }
            catch (Exception ex)
            {
                return Result.Failed;
            }
&lt;/PRE&gt;</description>
    <pubDate>Tue, 14 Feb 2017 12:16:43 GMT</pubDate>
    <dc:creator>FAIR59</dc:creator>
    <dc:date>2017-02-14T12:16:43Z</dc:date>
    <item>
      <title>How can I flip a section using the Revit 2017 API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-flip-a-section-using-the-revit-2017-api/m-p/6870324#M60263</link>
      <description>&lt;P&gt;I have a section that I want to flip using the Revit API just like doing it with the UI as seen below. &amp;nbsp;I've tried using the ElementTransformUtils.MirrorElement but that only creates a copy with a duplicate view.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Before" style="width: 342px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/321651i671F0BBFE3DE4672/image-size/large?v=v2&amp;amp;px=999" role="button" title="iylm9.png" alt="iylm9.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="After" style="width: 353px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/321653iD99FB4B44234BA5D/image-size/large?v=v2&amp;amp;px=999" role="button" title="y1njz.png" alt="y1njz.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here is a copy of my question on StackOverflow:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://stackoverflow.com/questions/42164282/how-can-i-flip-a-live-section-with-the-revit-api" target="_blank"&gt;http://stackoverflow.com/questions/42164282/how-can-i-flip-a-live-section-with-the-revit-api&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2017 21:43:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-flip-a-section-using-the-revit-2017-api/m-p/6870324#M60263</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-10T21:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: How can I flip a section using the Revit 2017 API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-flip-a-section-using-the-revit-2017-api/m-p/6874345#M60264</link>
      <description>&lt;P&gt;you can use another method from the ElementTransformUtils&amp;nbsp; (Revit 2017).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;ElementTransformUtils&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;.MirrorElements(document, sel , _plane, &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;false&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Consolas" size="2"&gt;with the 2nd argument a list of ElementId's&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Consolas" size="2"&gt;with the 4th argument set to false, meaning &amp;nbsp;no copies should be created and the elements should be mirrored directly.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2017 16:33:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-flip-a-section-using-the-revit-2017-api/m-p/6874345#M60264</guid>
      <dc:creator>FAIR59</dc:creator>
      <dc:date>2017-02-13T16:33:32Z</dc:date>
    </item>
    <item>
      <title>Re: How can I flip a section using the Revit 2017 API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-flip-a-section-using-the-revit-2017-api/m-p/6875751#M60265</link>
      <description>&lt;P&gt;mirroring only works if you set the flag to true - it only creates new elements and does nothing if boolean is set to false. Ideas?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2017 04:15:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-flip-a-section-using-the-revit-2017-api/m-p/6875751#M60265</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-14T04:15:15Z</dc:date>
    </item>
    <item>
      <title>Re: How can I flip a section using the Revit 2017 API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-flip-a-section-using-the-revit-2017-api/m-p/6876262#M60266</link>
      <description>&lt;P&gt;In my test, i selected the&amp;nbsp;section&amp;nbsp; in a plan view and mirrored&amp;nbsp;that section. That works fine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So you will have to find the section&amp;nbsp;&amp;nbsp;(Element of BuiltinCategory.OST_Viewers)&amp;nbsp;of your view&amp;nbsp;.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2017 10:36:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-flip-a-section-using-the-revit-2017-api/m-p/6876262#M60266</guid>
      <dc:creator>FAIR59</dc:creator>
      <dc:date>2017-02-14T10:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: How can I flip a section using the Revit 2017 API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-flip-a-section-using-the-revit-2017-api/m-p/6876459#M60267</link>
      <description>&lt;P&gt;Here is my testcode&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;            Document document = revit.Application.ActiveUIDocument.Document;
            Autodesk.Revit.DB.View _view2mirror = document.ActiveView;
            List&amp;lt;Element&amp;gt; _sections = new FilteredElementCollector(document)
            .OfCategory(BuiltInCategory.OST_Viewers)
            .ToList();
            Element _section = null;
            foreach (Element _e in _sections)
            {
                if (_e.Name == _view2mirror.Name &amp;amp;&amp;amp; _e.GetTypeId() == _view2mirror.GetTypeId()) _section = _e;
            }
            try
            {

                if( _section !=null)
            {
                using (Transaction t = new Transaction(document, "MirrorSection"))
                {
                    t.Start();
                    Plane _plane = Plane.CreateByNormalAndOrigin(_view2mirror.ViewDirection, _view2mirror.Origin);
                    ElementTransformUtils.MirrorElements(document, new List&amp;lt;ElementId&amp;gt; { _section.Id }, _plane, false);
                    t.Commit();
                }
            }
            return Result.Succeeded;
            }
            catch (Exception ex)
            {
                return Result.Failed;
            }
&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Feb 2017 12:16:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-flip-a-section-using-the-revit-2017-api/m-p/6876459#M60267</guid>
      <dc:creator>FAIR59</dc:creator>
      <dc:date>2017-02-14T12:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: How can I flip a section using the Revit 2017 API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-flip-a-section-using-the-revit-2017-api/m-p/6876853#M60268</link>
      <description>&lt;P&gt;Thanks FAIR59. &amp;nbsp;This worked for me in Revit 2017. &amp;nbsp;I didn't even think about trying the plural MirrorElements because I was just wanting to mirror one at a time and I assumed that it had the same function signature (other than single element vs. collection of elements) as the singular MirrorElement. &amp;nbsp;It seems odd to me that they excluded the mirrorCopies parameter from the singular version of the function.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2017 14:38:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-flip-a-section-using-the-revit-2017-api/m-p/6876853#M60268</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-14T14:38:35Z</dc:date>
    </item>
    <item>
      <title>Re: How can I flip a section using the Revit 2017 API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-flip-a-section-using-the-revit-2017-api/m-p/6876898#M60269</link>
      <description>&lt;P&gt;ksobon, are you using Revit 2017 or an older version?&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2017 14:55:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-flip-a-section-using-the-revit-2017-api/m-p/6876898#M60269</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-14T14:55:38Z</dc:date>
    </item>
  </channel>
</rss>

