<?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 How to create a reference line in revit API in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-create-a-reference-line-in-revit-api/m-p/9945936#M29510</link>
    <description>&lt;P&gt;I'm trying to create a reference line (not a reference plane) between two points on a plane. I couldn't find any method except for one method that changes the type of a model curve to a reference line. How can I do that through API?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for instance, please assume these two points:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;XYZ point1 = new XYZ(30, 12, 0);&lt;/P&gt;&lt;P&gt;XYZ point2 = new XYZ(10, 30, 0);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot in advance!&lt;/P&gt;</description>
    <pubDate>Thu, 17 Dec 2020 10:21:22 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-12-17T10:21:22Z</dc:date>
    <item>
      <title>How to create a reference line in revit API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-create-a-reference-line-in-revit-api/m-p/9945936#M29510</link>
      <description>&lt;P&gt;I'm trying to create a reference line (not a reference plane) between two points on a plane. I couldn't find any method except for one method that changes the type of a model curve to a reference line. How can I do that through API?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for instance, please assume these two points:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;XYZ point1 = new XYZ(30, 12, 0);&lt;/P&gt;&lt;P&gt;XYZ point2 = new XYZ(10, 30, 0);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2020 10:21:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-create-a-reference-line-in-revit-api/m-p/9945936#M29510</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-12-17T10:21:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a reference line in revit API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-create-a-reference-line-in-revit-api/m-p/9945990#M29511</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Try using the below code&lt;/P&gt;
&lt;LI-CODE lang="general"&gt; Plane P = Plane.CreateByNormalAndOrigin(XYZ.BasisZ, new XYZ(0, 0, 0));
            SketchPlane sp = SketchPlane.Create(doc, P);
            XYZ startPoint;
            XYZ endPoint;
            Line l1 = Line.CreateBound(startPoint,endPoint);
            ModelLine mLine = doc.FamilyCreate.NewModelCurve(l1,sp) as ModelLine;           
            if (mLine!=null)
            {
                mLine.ChangeToReferenceLine();
            }            &lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 17 Dec 2020 10:47:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-create-a-reference-line-in-revit-api/m-p/9945990#M29511</guid>
      <dc:creator>naveen.kumar.t</dc:creator>
      <dc:date>2020-12-17T10:47:11Z</dc:date>
    </item>
  </channel>
</rss>

