<?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 do i retrieve the start and end points of an element? in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/how-do-i-retrieve-the-start-and-end-points-of-an-element/m-p/11715155#M14185</link>
    <description>&lt;P&gt;Hi Marty,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the above. I have previously tried casting to a LocationCurve property, but this seems to throw a NullReferenceException. I have checked that the element.Location property exists and is not null, so it looks like the issue is the actual casting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any other way i could do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Jack&lt;/P&gt;</description>
    <pubDate>Mon, 30 Jan 2023 09:33:30 GMT</pubDate>
    <dc:creator>jmadeley37KVE</dc:creator>
    <dc:date>2023-01-30T09:33:30Z</dc:date>
    <item>
      <title>How do i retrieve the start and end points of an element?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-do-i-retrieve-the-start-and-end-points-of-an-element/m-p/11715088#M14183</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've inserted an Adaptive Family Instance in my model using the Revit API and now need to add some annotations on a view. The adaptive family required a start and end point (P1 and P2) to insert, is there a way I can convert the element.Location prooperty to a LocationCurve in Revit 2023?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried casting:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var locationCurve = element.Location as LocationCurve;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but this throws a Null Reference Exception. If anyone knows a way to do this in my version of Revit I would really appreciate the help &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;Thanks&lt;/P&gt;&lt;P&gt;Jack&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2023 08:54:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-do-i-retrieve-the-start-and-end-points-of-an-element/m-p/11715088#M14183</guid>
      <dc:creator>jmadeley37KVE</dc:creator>
      <dc:date>2023-01-30T08:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do i retrieve the start and end points of an element?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-do-i-retrieve-the-start-and-end-points-of-an-element/m-p/11715155#M14185</link>
      <description>&lt;P&gt;Hi Marty,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the above. I have previously tried casting to a LocationCurve property, but this seems to throw a NullReferenceException. I have checked that the element.Location property exists and is not null, so it looks like the issue is the actual casting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any other way i could do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Jack&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2023 09:33:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-do-i-retrieve-the-start-and-end-points-of-an-element/m-p/11715155#M14185</guid>
      <dc:creator>jmadeley37KVE</dc:creator>
      <dc:date>2023-01-30T09:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: How do i retrieve the start and end points of an element?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-do-i-retrieve-the-start-and-end-points-of-an-element/m-p/11715316#M14186</link>
      <description>&lt;P&gt;After doing some digging through the documentation, I think I have come up with a way to get the co-ordinates.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you use the method GetFamilyPointPlacementReferences() on the element, you are returned an IList&amp;lt;FamilyPointPlacementReference&amp;gt; object. With this list you can use a Linq Select statement to get the Location object and inside the transform is the origin XYZ.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var references = element.GetFamilyPointPlacementReference().Select(x =&amp;gt; x.Location.Origin)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The references object is a series of XYZ points that we can then use for any further logic. It looks like the FamilyPointPlacementReference's that are returned from the GetFamilyPointPlacementReference() method have a name which in my case were "END1" and "END2". In my case this worked perfectly for finding the start and end points.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2023 11:04:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-do-i-retrieve-the-start-and-end-points-of-an-element/m-p/11715316#M14186</guid>
      <dc:creator>jmadeley37KVE</dc:creator>
      <dc:date>2023-01-30T11:04:46Z</dc:date>
    </item>
  </channel>
</rss>

