<?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 get the coordinates of the endpoints for a section marker line seg in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-get-the-coordinates-of-the-endpoints-for-a-section/m-p/6957855#M60217</link>
    <description>&lt;P&gt;Amazing work. I would have just used Section.Line.StartPoint.X. Please, it's a joke...&lt;/P&gt;
&lt;P&gt;The question: Where did you come up with the "const double _correction =&amp;nbsp;21.130014403 / 304.8;" value?&lt;/P&gt;
&lt;P&gt;Am I understanding correctly that this value (21.1300 etc.) will be dependant on the size and scale of the section marker circle? If so, a custom one would be a different value, correct? Thanks for posting this very helpful code. Regards, Dale&lt;/P&gt;</description>
    <pubDate>Mon, 20 Mar 2017 10:44:41 GMT</pubDate>
    <dc:creator>Dale.Bartlett</dc:creator>
    <dc:date>2017-03-20T10:44:41Z</dc:date>
    <item>
      <title>How can I get the coordinates of the endpoints for a section marker line segment</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-get-the-coordinates-of-the-endpoints-for-a-section/m-p/6877871#M60207</link>
      <description>&lt;P&gt;I have a section marker for which&amp;nbsp;I would like to do a rotation around one of the endpoints of the line segment leader but I haven't been able to figure out how to get the coordinates of the endpoint. &amp;nbsp;I'm able to get the bounding box of the overall section marker but not these specific coordinates. &amp;nbsp;How can I do this?&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="Section Marker Coordinates.png" style="width: 439px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/322696iEC5BB902BC0BAB6C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Section Marker Coordinates.png" alt="Section Marker Coordinates.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2017 20:07:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-get-the-coordinates-of-the-endpoints-for-a-section/m-p/6877871#M60207</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-14T20:07:53Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get the coordinates of the endpoints for a section marker line seg</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-get-the-coordinates-of-the-endpoints-for-a-section/m-p/6879059#M60208</link>
      <description>&lt;P&gt;Dear Skeletank,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am checking with the development team for you... hang on...&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;</description>
      <pubDate>Wed, 15 Feb 2017 10:54:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-get-the-coordinates-of-the-endpoints-for-a-section/m-p/6879059#M60208</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2017-02-15T10:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get the coordinates of the endpoints for a section marker line seg</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-get-the-coordinates-of-the-endpoints-for-a-section/m-p/6919915#M60209</link>
      <description>&lt;P&gt;Hi Jeremy,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have you heard anything back from the development team? &amp;nbsp;My bigger problem involves reversing the effects of the built-in "Mirror Project" tool and part of that includes reference section markers inside of another section that has been flipped. &amp;nbsp;I would like to fix their orientation by rotating 180 degrees around the endpoint.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2017 20:28:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-get-the-coordinates-of-the-endpoints-for-a-section/m-p/6919915#M60209</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-03T20:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get the coordinates of the endpoints for a section marker line seg</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-get-the-coordinates-of-the-endpoints-for-a-section/m-p/6924155#M60210</link>
      <description>&lt;P&gt;Yes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;They say:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1.&amp;nbsp;&lt;SPAN class="s1"&gt;The section marker element is not exposed as a specific element type so I don’t think this position can be read at this time.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="s1"&gt;2. Regarding&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;“Mirror Project”: &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;I don’t have good ideas to add.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Sorry for not being of more help!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Cheers,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Jeremy&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2017 17:12:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-get-the-coordinates-of-the-endpoints-for-a-section/m-p/6924155#M60210</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2017-03-06T17:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get the coordinates of the endpoints for a section marker line seg</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-get-the-coordinates-of-the-endpoints-for-a-section/m-p/6927482#M60211</link>
      <description>&lt;P&gt;I was assuming that would be the response but thank you very much Jeremy for checking with the development team for me.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 19:10:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-get-the-coordinates-of-the-endpoints-for-a-section/m-p/6927482#M60211</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-07T19:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get the coordinates of the endpoints for a section marker line seg</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-get-the-coordinates-of-the-endpoints-for-a-section/m-p/6928342#M60212</link>
      <description>&lt;P&gt;I've found a workaround for your question&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A transaction&amp;nbsp;needs to be active when you call the method, as the method hides the section tag and viewer_reference_label_text temporarily.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;        private Line GetSectionLine(Element _section, Autodesk.Revit.DB.View _view)
        {
            const double _correction = 21.130014403 / 304.8;
            if (_section.Category == null) return null;
            if ((BuiltInCategory)_section.Category.Id.IntegerValue != BuiltInCategory.OST_Viewers) return null;

            List&amp;lt;Autodesk.Revit.DB.View&amp;gt; _views = new FilteredElementCollector(_section.Document)
                .OfClass(typeof(Autodesk.Revit.DB.View))
                .Cast&amp;lt;Autodesk.Revit.DB.View&amp;gt;()
                .ToList();
            Autodesk.Revit.DB.View _viewFromSection = null;
            foreach (var v in _views)
            {
                if (_section.Name == v.Name &amp;amp;&amp;amp; _section.GetTypeId() == v.GetTypeId()) _viewFromSection = v;
            }
            if (_viewFromSection == null) return null;
            ViewFamilyType _vType = _section.Document.GetElement(_section.GetTypeId()) as ViewFamilyType;
            BoundingBoxXYZ _bb1 = null;
            using (SubTransaction st1 = new SubTransaction(_section.Document))
            {
                st1.Start();
                Parameter par = _vType.get_Parameter(BuiltInParameter.SECTION_TAG);
                par.Set(ElementId.InvalidElementId);
                par = _vType.get_Parameter(BuiltInParameter.VIEWER_REFERENCE_LABEL_TEXT);
                par.Set(string.Empty);
                _view.Scale = 1;
                _section.Document.Regenerate();
                _bb1 = _section.get_BoundingBox(_view);
                st1.RollBack();
            }
            BoundingBoxXYZ _ViewBB = _viewFromSection.get_BoundingBox(_viewFromSection);
            BoundingBoxXYZ _bb = _section.get_BoundingBox(_view);
            XYZ pt1 = _bb.Min;
            XYZ pt2 = _bb.Max;
            if (_bb1 != null)
            {
                pt1 = _bb1.Min;
                pt2 = _bb1.Max;
            }
            XYZ Origin = _viewFromSection.Origin;
            XYZ ViewBasisX = _viewFromSection.RightDirection;
            XYZ ViewBasisY = _viewFromSection.ViewDirection;
            if (ViewBasisX.X &amp;lt; 0 ^ ViewBasisX.Y &amp;lt; 0)
            {
                double _d = pt1.Y;
                pt1 = new XYZ(pt1.X, pt2.Y, pt1.Z);
                pt2 = new XYZ(pt2.X, _d, pt2.Z);
            }
            XYZ ToPlane1 = pt1.Add(ViewBasisY.Multiply(ViewBasisY.DotProduct(Origin.Subtract(pt1))));
            XYZ ToPlane2 = pt2.Subtract(ViewBasisY.Multiply(ViewBasisY.DotProduct(pt2.Subtract(Origin))));
            XYZ _correctionVector = ToPlane2.Subtract(ToPlane1).Normalize().Multiply(_correction);
            XYZ endPoint0 = ToPlane1.Add(_correctionVector);
            XYZ endPoint1 = ToPlane2.Subtract(_correctionVector);

            return Line.CreateBound(endPoint0, endPoint1);
        }
&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Mar 2017 00:42:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-get-the-coordinates-of-the-endpoints-for-a-section/m-p/6928342#M60212</guid>
      <dc:creator>FAIR59</dc:creator>
      <dc:date>2017-03-08T00:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get the coordinates of the endpoints for a section marker line seg</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-get-the-coordinates-of-the-endpoints-for-a-section/m-p/6930359#M60213</link>
      <description>&lt;P&gt;Beautiful sample!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Especially after the development team said 'no hope' &amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you, and congratulations!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Definitive blog post material, if I may...&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;</description>
      <pubDate>Wed, 08 Mar 2017 15:16:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-get-the-coordinates-of-the-endpoints-for-a-section/m-p/6930359#M60213</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2017-03-08T15:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get the coordinates of the endpoints for a section marker line seg</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-get-the-coordinates-of-the-endpoints-for-a-section/m-p/6934533#M60214</link>
      <description>&lt;P&gt;FAIR59,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the response. &amp;nbsp;I have a few questions:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Where did you come up with the "const double _correction =&amp;nbsp;21.130014403 / 304.8;" value?&lt;/LI&gt;&lt;LI&gt;How do you distinguish between section vs. callout markers since they are both of category OST_VIEWERS?&lt;/LI&gt;&lt;LI&gt;Would this work for section markers that are only references (such as ones that reference drafting views)?&lt;/LI&gt;&lt;LI&gt;How do you know which endpoint is associated with the tail and which one is associated with the head?&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Thu, 09 Mar 2017 15:48:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-get-the-coordinates-of-the-endpoints-for-a-section/m-p/6934533#M60214</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-09T15:48:45Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get the coordinates of the endpoints for a section marker line seg</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-get-the-coordinates-of-the-endpoints-for-a-section/m-p/6935353#M60215</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/413917"&gt;@jeremytammik&lt;/a&gt;&amp;nbsp;: feel free to use my contributions for your blog&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;@Anonymous:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;answer&amp;nbsp;1.&lt;/P&gt;
&lt;P&gt;the boundingbox of a sectionline is the result of a number of elements&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;the line&lt;/LI&gt;
&lt;LI&gt;the section head&lt;/LI&gt;
&lt;LI&gt;the reference label text&lt;/LI&gt;
&lt;LI&gt;the cycle symbol&amp;nbsp;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BoundingBox.PNG" style="width: 490px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/331440i7932B2CBFBF28B93/image-size/large?v=v2&amp;amp;px=999" role="button" title="BoundingBox.PNG" alt="BoundingBox.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in the method I "hide" 2 and 3.&amp;nbsp;You can't hide&amp;nbsp;the cycle symbol, so the result is to large. I simply added the resulting line&amp;nbsp;without the correction to the project&amp;nbsp;&amp;nbsp;and measured the surplus length. After checking that it is always the same, I implemented the constant&amp;nbsp; _correction = 21.130014403 / 304.8&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;answer 2.&lt;/P&gt;
&lt;P&gt;I didn't distinguish between section vs. callout markers, I merely presumed you had a section marker. There are 2 ways to test&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;P&gt;if (_vType.FamilyName == "Section")&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;if (_viewFromSection.GetType()== typeof(ViewSection))&lt;/P&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;callouts are PlanViews or Elevations, as far as I know.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;answer 3.&lt;/P&gt;
&lt;P&gt;I don't know&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;answer 4.&lt;/P&gt;
&lt;P&gt;i'm afraid that is truly hidden. The Section Head and Tail stay&amp;nbsp;in the same position when flipping the section, but the viewDirection and RightDirection changes.&lt;/P&gt;
&lt;P&gt;The most you can get is a line in the View.RightDirection&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;            XYZ _direction = ToPlane2.Subtract(ToPlane1).Normalize();
            return _direction.IsAlmostEqualTo(ViewBasisX) ? Line.CreateBound(endPoint0, endPoint1) : Line.CreateBound(endPoint1, endPoint0);
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2017 20:05:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-get-the-coordinates-of-the-endpoints-for-a-section/m-p/6935353#M60215</guid>
      <dc:creator>FAIR59</dc:creator>
      <dc:date>2017-03-09T20:05:24Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get the coordinates of the endpoints for a section marker line seg</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-get-the-coordinates-of-the-endpoints-for-a-section/m-p/6957772#M60216</link>
      <description>&lt;P&gt;Cool solution, cool answers!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Preserved by The Building Coder for posterity here:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://thebuildingcoder.typepad.com/blog/2017/03/ttt-to-obtain-section-marker-endpoint.html" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2017/03/ttt-to-obtain-section-marker-endpoint.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2017 10:09:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-get-the-coordinates-of-the-endpoints-for-a-section/m-p/6957772#M60216</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2017-03-20T10:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get the coordinates of the endpoints for a section marker line seg</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-get-the-coordinates-of-the-endpoints-for-a-section/m-p/6957855#M60217</link>
      <description>&lt;P&gt;Amazing work. I would have just used Section.Line.StartPoint.X. Please, it's a joke...&lt;/P&gt;
&lt;P&gt;The question: Where did you come up with the "const double _correction =&amp;nbsp;21.130014403 / 304.8;" value?&lt;/P&gt;
&lt;P&gt;Am I understanding correctly that this value (21.1300 etc.) will be dependant on the size and scale of the section marker circle? If so, a custom one would be a different value, correct? Thanks for posting this very helpful code. Regards, Dale&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2017 10:44:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-get-the-coordinates-of-the-endpoints-for-a-section/m-p/6957855#M60217</guid>
      <dc:creator>Dale.Bartlett</dc:creator>
      <dc:date>2017-03-20T10:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get the coordinates of the endpoints for a section marker line segment</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-get-the-coordinates-of-the-endpoints-for-a-section/m-p/13304007#M60218</link>
      <description>&lt;P&gt;Has there been any development in accessing and modifying section markers from revit api? They are incredibly slow to edit by hand - programmatic access would be tremendously helpful. Length, start point and end point would help a lot.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2025 16:12:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-get-the-coordinates-of-the-endpoints-for-a-section/m-p/13304007#M60218</guid>
      <dc:creator>DanielKP2Z9V</dc:creator>
      <dc:date>2025-02-06T16:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get the coordinates of the endpoints for a section marker line segment</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-get-the-coordinates-of-the-endpoints-for-a-section/m-p/13305365#M60219</link>
      <description>&lt;P&gt;Dear Daniel,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I asked the Gemini LLM for you, as &lt;A href="https://thebuildingcoder.typepad.com/blog/2025/01/access-to-uiapplication-tags-and-llm-api-support.html#2" target="_blank"&gt;described in my blog post&lt;/A&gt;, using the following prompt:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;You are a seasoned Revit add-in programmer and .NET expert with deep expertise in BIM principles and the Revit API. Your task is to address complex, technical questions raised by experienced Revit add-in developers in the Revit API forum. Leverage insights from The Building Coder blog, respected Revit API resources, and community feedback to provide innovative and practical solutions. Include clear explanations, advanced code examples, actionable snippets, and practical demonstrations to ensure effectiveness and clarity: it is tricky to access and modify the coordinates of the end point of a section view marker; The Building Coder published a tricky solution using the temporary transaction trick in 2017; is there any easier and more direct way to achieve that today?&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;It spouts a confident and sensible-sounding answer, but I have no idea whether it is hallucinating or based on true facts.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I'll share it with you in case it contains any new hints or ideas that we were not aware of in the discussion above; you will be more capable than I at pointing out its faults, in case not:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;U&gt;&lt;STRONG&gt;Gemini&lt;/STRONG&gt;&lt;/U&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;You're right, manipulating section view marker endpoints has historically been tricky. The "temporary transaction trick" described by The Building Coder in 2017 (and likely referencing Jeremy Tammik's work) was a clever workaround for limitations in the Revit API. While still functional, it's not the most elegant or performant approach. Thankfully, recent Revit API improvements offer a more direct and cleaner solution.&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV id="model-response-message-contentr_60fdadae56b68bd5" class="markdown markdown-main-panel stronger" dir="ltr"&gt;
&lt;P data-sourcepos="3:1-3:53"&gt;Let's break down the problem and the modern solution:&lt;/P&gt;
&lt;P data-sourcepos="5:1-5:18"&gt;&lt;STRONG&gt;The Challenge:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P data-sourcepos="7:1-7:363"&gt;Section view markers are represented by &lt;CODE&gt;ViewSection&lt;/CODE&gt; elements. Their geometry, specifically the endpoint location, is tied to the view's crop region and internal Revit workings. Directly setting the endpoint coordinates can lead to unexpected behavior or exceptions because Revit manages the relationship between the section line and the generated section view.&lt;/P&gt;
&lt;P data-sourcepos="9:1-9:47"&gt;&lt;STRONG&gt;The Modern Solution: &lt;CODE&gt;CropBox&lt;/CODE&gt; Manipulation&lt;/STRONG&gt;&lt;/P&gt;
&lt;P data-sourcepos="11:1-11:256"&gt;The key is to understand that the section line's endpoint is directly related to the section view's &lt;CODE&gt;CropBox&lt;/CODE&gt;. By modifying the &lt;CODE&gt;CropBox&lt;/CODE&gt;, we indirectly control the section line's endpoint. This avoids the transactional complexities of the older approach.&lt;/P&gt;
&lt;P data-sourcepos="13:1-13:56"&gt;Here's a breakdown of the process and a C# code example:&lt;/P&gt;
&lt;OL data-sourcepos="15:1-22:0"&gt;
&lt;LI data-sourcepos="15:1-16:0"&gt;
&lt;P data-sourcepos="15:4-15:232"&gt;&lt;STRONG&gt;Get the &lt;CODE&gt;ViewSection&lt;/CODE&gt;:&lt;/STRONG&gt; Obtain the &lt;CODE&gt;ViewSection&lt;/CODE&gt; element representing the section view marker you want to modify. You can do this by selecting it, iterating through views, or other methods depending on your add-in's context.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI data-sourcepos="17:1-18:0"&gt;
&lt;P data-sourcepos="17:4-17:124"&gt;&lt;STRONG&gt;Access the &lt;CODE&gt;CropBox&lt;/CODE&gt;:&lt;/STRONG&gt; The &lt;CODE&gt;ViewSection&lt;/CODE&gt; has a &lt;CODE&gt;CropBox&lt;/CODE&gt; property. This is the crucial element we need to manipulate.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI data-sourcepos="19:1-20:0"&gt;
&lt;P data-sourcepos="19:4-19:269"&gt;&lt;STRONG&gt;Modify the &lt;CODE&gt;CropBox&lt;/CODE&gt;'s &lt;CODE&gt;Max&lt;/CODE&gt; or &lt;CODE&gt;Min&lt;/CODE&gt; Point:&lt;/STRONG&gt; The &lt;CODE&gt;CropBox&lt;/CODE&gt; is defined by a &lt;CODE&gt;BoundingBoxXYZ&lt;/CODE&gt;. The section line's endpoint corresponds to one of the corner points of this bounding box. You'll typically adjust the &lt;CODE&gt;Max&lt;/CODE&gt; point in the direction of the section line.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI data-sourcepos="21:1-22:0"&gt;
&lt;P data-sourcepos="21:4-21:207"&gt;&lt;STRONG&gt;Update the &lt;CODE&gt;ViewSection&lt;/CODE&gt;:&lt;/STRONG&gt; After modifying the &lt;CODE&gt;CropBox&lt;/CODE&gt;, the &lt;CODE&gt;ViewSection&lt;/CODE&gt; will automatically update, reflecting the changed endpoint. No explicit transaction is required for this specific operation.&lt;/P&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;DIV class="code-block ng-tns-c2470539471-18 ng-trigger ng-trigger-codeBlockRevealAnimation"&gt;
&lt;DIV class="code-block-decoration header-formatted gds-title-s ng-tns-c2470539471-18 ng-star-inserted"&gt;&lt;SPAN class="ng-tns-c2470539471-18"&gt;C#&lt;/SPAN&gt;
&lt;DIV class="buttons ng-tns-c2470539471-18 ng-star-inserted"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="formatted-code-block-internal-container ng-tns-c2470539471-18"&gt;
&lt;DIV class="animated-opacity ng-tns-c2470539471-18"&gt;
&lt;PRE class="ng-tns-c2470539471-18"&gt;&lt;CODE class="code-container formatted ng-tns-c2470539471-18" role="text" data-test-id="code-content" data-sourcepos="23:1-73:1"&gt;&lt;SPAN class="hljs-keyword"&gt;using&lt;/SPAN&gt; Autodesk.Revit.DB;
&lt;SPAN class="hljs-keyword"&gt;using&lt;/SPAN&gt; Autodesk.Revit.UI;
&lt;SPAN class="hljs-keyword"&gt;using&lt;/SPAN&gt; System;

&lt;SPAN class="hljs-keyword"&gt;namespace&lt;/SPAN&gt; &lt;SPAN class="hljs-title"&gt;RevitAddin&lt;/SPAN&gt;
{
    [&lt;SPAN class="hljs-meta"&gt;Transaction(TransactionMode.Manual)&lt;/SPAN&gt;] &lt;SPAN class="hljs-comment"&gt;// Or Automatic if appropriate for your context&lt;/SPAN&gt;
    &lt;SPAN class="hljs-keyword"&gt;public&lt;/SPAN&gt; &lt;SPAN class="hljs-keyword"&gt;class&lt;/SPAN&gt; &lt;SPAN class="hljs-title"&gt;ModifySectionEndpoint&lt;/SPAN&gt; : &lt;SPAN class="hljs-title"&gt;&lt;SPAN class="citation-0"&gt;IExternalCommand&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="citation-0"&gt;
    {
        &lt;/SPAN&gt;&lt;SPAN class="hljs-function"&gt;&lt;SPAN class="hljs-keyword"&gt;&lt;SPAN class="citation-0"&gt;public&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="citation-0"&gt; Result &lt;/SPAN&gt;&lt;SPAN class="hljs-title"&gt;&lt;SPAN class="citation-0"&gt;Execute&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="citation-0"&gt;(&lt;/SPAN&gt;&lt;SPAN class="hljs-params"&gt;&lt;SPAN class="citation-0"&gt;ExternalCommandData commandData, &lt;/SPAN&gt;&lt;SPAN class="hljs-keyword"&gt;&lt;SPAN class="citation-0"&gt;ref&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="hljs-built_in"&gt;&lt;SPAN class="citation-0"&gt;string&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="citation-0"&gt; message, ElementSet elements&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="citation-0"&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="citation-0 citation-end-0"&gt;
        {
            UIApplication uiapp = commandData.Application;
            UIDocument uidoc = uiapp.ActiveUIDocument;
            Document doc = uidoc.Document;&lt;/SPAN&gt;

            &lt;SPAN class="hljs-comment"&gt;// 1. Get the ViewSection (assuming you have it selected)&lt;/SPAN&gt;
            ViewSection viewSection = &lt;SPAN class="hljs-literal"&gt;null&lt;/SPAN&gt;;
            Selection selection = uidoc.Selection;
            &lt;SPAN class="hljs-keyword"&gt;if&lt;/SPAN&gt; (selection.GetElementIds().Count &amp;gt; &lt;SPAN class="hljs-number"&gt;0&lt;/SPAN&gt;)
            {
                Element element = doc.GetElement(selection.GetElementIds().First());
                viewSection = element &lt;SPAN class="hljs-keyword"&gt;as&lt;/SPAN&gt; ViewSection;
            }

            &lt;SPAN class="hljs-keyword"&gt;if&lt;/SPAN&gt; (viewSection == &lt;SPAN class="hljs-literal"&gt;null&lt;/SPAN&gt;)
            {
                TaskDialog.TaskDialog.Show(&lt;SPAN class="hljs-string"&gt;"Error"&lt;/SPAN&gt;, &lt;SPAN class="hljs-string"&gt;"Please select a section view."&lt;/SPAN&gt;);
                &lt;SPAN class="hljs-keyword"&gt;return&lt;/SPAN&gt; Result.Failed;
            }


            &lt;SPAN class="hljs-comment"&gt;// 2. Access the CropBox&lt;/SPAN&gt;
            CropBox cropBox = viewSection.CropBox;

            &lt;SPAN class="hljs-comment"&gt;// 3. Modify the Max point (adjust as needed for your section direction)&lt;/SPAN&gt;
            XYZ currentMax = cropBox.Max;
            XYZ offset = &lt;SPAN class="hljs-keyword"&gt;new&lt;/SPAN&gt; XYZ(&lt;SPAN class="hljs-number"&gt;1&lt;/SPAN&gt;, &lt;SPAN class="hljs-number"&gt;0&lt;/SPAN&gt;, &lt;SPAN class="hljs-number"&gt;0&lt;/SPAN&gt;); &lt;SPAN class="hljs-comment"&gt;// Example offset - adjust as needed&lt;/SPAN&gt;
            XYZ newMax = currentMax + offset;

            cropBox.Max = newMax;

            &lt;SPAN class="hljs-comment"&gt;// 4. Update is automatic - no transaction needed for CropBox modification in this context.&lt;/SPAN&gt;

            uidoc.RefreshActiveView(); &lt;SPAN class="hljs-comment"&gt;// Important: Refresh the view to see the change&lt;/SPAN&gt;

            &lt;SPAN class="hljs-keyword"&gt;return&lt;/SPAN&gt; Result.Succeeded;
        }
    }
}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P data-sourcepos="75:1-75:60"&gt;&lt;STRONG&gt;Key Improvements over the "Temporary Transaction Trick":&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL data-sourcepos="77:1-80:0"&gt;
&lt;LI data-sourcepos="77:1-77:115"&gt;&lt;STRONG&gt;Simplicity:&lt;/STRONG&gt; Direct &lt;CODE&gt;CropBox&lt;/CODE&gt; manipulation is much more straightforward than managing temporary transactions.&lt;/LI&gt;
&lt;LI data-sourcepos="78:1-78:167"&gt;&lt;STRONG&gt;Performance:&lt;/STRONG&gt; Avoids the overhead of creating and committing transactions, resulting in better performance, especially when modifying multiple section endpoints.&lt;/LI&gt;
&lt;LI data-sourcepos="79:1-80:0"&gt;&lt;STRONG&gt;Clarity:&lt;/STRONG&gt; The code is more readable and easier to understand, making maintenance and debugging simpler.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P data-sourcepos="81:1-81:29"&gt;&lt;STRONG&gt;Important Considerations:&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL data-sourcepos="83:1-87:0"&gt;
&lt;LI data-sourcepos="83:1-83:172"&gt;&lt;STRONG&gt;Section Direction:&lt;/STRONG&gt; Ensure you modify the correct &lt;CODE&gt;CropBox&lt;/CODE&gt; point (&lt;CODE&gt;Max&lt;/CODE&gt; or &lt;CODE&gt;Min&lt;/CODE&gt;) and the appropriate coordinates (X, Y, or Z) based on the section view's direction.&lt;/LI&gt;
&lt;LI data-sourcepos="84:1-84:100"&gt;&lt;STRONG&gt;Units:&lt;/STRONG&gt; Work with Revit's internal units (feet). Convert to/from your desired units as needed.&lt;/LI&gt;
&lt;LI data-sourcepos="85:1-85:154"&gt;&lt;STRONG&gt;Error Handling:&lt;/STRONG&gt; Include robust error handling to handle cases where the selected element isn't a &lt;CODE&gt;ViewSection&lt;/CODE&gt; or if other unexpected issues occur.&lt;/LI&gt;
&lt;LI data-sourcepos="86:1-87:0"&gt;&lt;STRONG&gt;View Refresh:&lt;/STRONG&gt; The &lt;CODE&gt;uidoc.RefreshActiveView()&lt;/CODE&gt; is often crucial to immediately visualize the change in the Revit UI.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P data-sourcepos="88:1-88:286"&gt;By using this &lt;CODE&gt;CropBox&lt;/CODE&gt; approach, you can efficiently and reliably manipulate section view marker endpoints in your Revit add-ins, leveraging the power of the modern Revit API. This method is significantly more efficient and easier to maintain than the older transactional workarounds.&lt;/P&gt;
&lt;P data-sourcepos="88:1-88:286"&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P data-sourcepos="88:1-88:286"&gt;What say you? True, false, ridiculous, helpful? Exploring the new technology and its limits...&amp;nbsp;Thank you for checking and letting us know.&amp;nbsp;&lt;/P&gt;
&lt;P data-sourcepos="88:1-88:286"&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 07 Feb 2025 10:00:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-get-the-coordinates-of-the-endpoints-for-a-section/m-p/13305365#M60219</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2025-02-07T10:00:08Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get the coordinates of the endpoints for a section marker line segment</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-get-the-coordinates-of-the-endpoints-for-a-section/m-p/13306027#M60220</link>
      <description>&lt;P&gt;thanks Jeremy, I haven't tried asking this question to Gemini, but I tried all the other big 3 LLMs and none of them knew the answer. I don't think Gemini got it quite right neither sadly, because it assumes that you want section marker to be exactly where section's crop region is, which isn't always the case - sometimes you want to offset section markers slightly to avoid it clashing with other elements in a view.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I think we need to nag autodesk to expose this functionality. I know it's an uphill battle, but this time, this time I believe it will work &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2025 15:16:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-get-the-coordinates-of-the-endpoints-for-a-section/m-p/13306027#M60220</guid>
      <dc:creator>DanielKP2Z9V</dc:creator>
      <dc:date>2025-02-07T15:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get the coordinates of the endpoints for a section marker line segment</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-get-the-coordinates-of-the-endpoints-for-a-section/m-p/13778596#M84499</link>
      <description>&lt;P&gt;Only thing missing from this thread was a Revit idea link to Autodesk forums.&lt;/P&gt;&lt;P&gt;Here is some nagging:&lt;BR /&gt;&lt;A href="https://forums.autodesk.com/t5/revit-ideas/increased-api-functionality-for-sections/idi-p/13778572" target="_blank"&gt;Increased API Functionality for Sections - Autodesk Community&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Aug 2025 09:55:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-can-i-get-the-coordinates-of-the-endpoints-for-a-section/m-p/13778596#M84499</guid>
      <dc:creator>EIVOE</dc:creator>
      <dc:date>2025-08-22T09:55:48Z</dc:date>
    </item>
  </channel>
</rss>

