<?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 NurbSpline Creation Error in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/nurbspline-creation-error/m-p/5652627#M72200</link>
    <description>&lt;P&gt;&lt;SPAN&gt;I'm working on a Revit plugin that in part accepts curves from Rhino that can be used to create a beam&amp;nbsp;in Revit. &lt;BR /&gt;My code works well, when controlpoints of curve are&amp;nbsp;greater than or equal to four.&amp;nbsp;But with three control points arises a problem.&lt;BR /&gt;How can I draw three&amp;nbsp;control points curve in Revit API?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;List&amp;lt;XYZ&amp;gt; ctrPoints = new List&amp;lt;XYZ&amp;gt;();&lt;BR /&gt; &lt;BR /&gt; ctrPoints.Add(new XYZ(Utils.mmToFeet(72500.017337), Utils.mmToFeet(-5072.522765), Utils.mmToFeet(0)));&lt;BR /&gt; ctrPoints.Add(new XYZ(Utils.mmToFeet(105082.371745), Utils.mmToFeet(-748.798009), tils.mmToFeet(0)));&lt;BR /&gt; ctrPoints.Add(new XYZ(Utils.mmToFeet(117899.12727), Utils.mmToFeet(-15572.997171), Utils.mmToFeet(0)));&lt;BR /&gt; &lt;BR /&gt; List&amp;lt;double&amp;gt; weights = new List&amp;lt;double&amp;gt;();&lt;BR /&gt; weights.Add(1);&lt;BR /&gt; weights.Add(1);&lt;BR /&gt; weights.Add(1);&lt;BR /&gt; &lt;BR /&gt; List&amp;lt;double&amp;gt; knots = new List&amp;lt;double&amp;gt;();&lt;BR /&gt; knots.Add(0);&lt;BR /&gt; knots.Add(0);&lt;BR /&gt; knots.Add(0);&lt;BR /&gt; knots.Add(52464.568605);&lt;BR /&gt; knots.Add(52464.568605);&lt;BR /&gt; knots.Add(52464.568605);&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;NurbSpline detailNurbSpline = NurbSpline.Create(ctrPoints, weights, knots, 3, false, true);&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 26 May 2015 22:59:15 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-05-26T22:59:15Z</dc:date>
    <item>
      <title>NurbSpline Creation Error</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/nurbspline-creation-error/m-p/5652627#M72200</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I'm working on a Revit plugin that in part accepts curves from Rhino that can be used to create a beam&amp;nbsp;in Revit. &lt;BR /&gt;My code works well, when controlpoints of curve are&amp;nbsp;greater than or equal to four.&amp;nbsp;But with three control points arises a problem.&lt;BR /&gt;How can I draw three&amp;nbsp;control points curve in Revit API?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;List&amp;lt;XYZ&amp;gt; ctrPoints = new List&amp;lt;XYZ&amp;gt;();&lt;BR /&gt; &lt;BR /&gt; ctrPoints.Add(new XYZ(Utils.mmToFeet(72500.017337), Utils.mmToFeet(-5072.522765), Utils.mmToFeet(0)));&lt;BR /&gt; ctrPoints.Add(new XYZ(Utils.mmToFeet(105082.371745), Utils.mmToFeet(-748.798009), tils.mmToFeet(0)));&lt;BR /&gt; ctrPoints.Add(new XYZ(Utils.mmToFeet(117899.12727), Utils.mmToFeet(-15572.997171), Utils.mmToFeet(0)));&lt;BR /&gt; &lt;BR /&gt; List&amp;lt;double&amp;gt; weights = new List&amp;lt;double&amp;gt;();&lt;BR /&gt; weights.Add(1);&lt;BR /&gt; weights.Add(1);&lt;BR /&gt; weights.Add(1);&lt;BR /&gt; &lt;BR /&gt; List&amp;lt;double&amp;gt; knots = new List&amp;lt;double&amp;gt;();&lt;BR /&gt; knots.Add(0);&lt;BR /&gt; knots.Add(0);&lt;BR /&gt; knots.Add(0);&lt;BR /&gt; knots.Add(52464.568605);&lt;BR /&gt; knots.Add(52464.568605);&lt;BR /&gt; knots.Add(52464.568605);&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;NurbSpline detailNurbSpline = NurbSpline.Create(ctrPoints, weights, knots, 3, false, true);&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2015 22:59:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/nurbspline-creation-error/m-p/5652627#M72200</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-26T22:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: NurbSpline Creation Error</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/nurbspline-creation-error/m-p/5653109#M72201</link>
      <description>&lt;P&gt;Dear Anarchyfree,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Congratulations on your interesting project!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am glad to hear that it is working well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Would you like to share some of it here? I am sure there would be a lot of interest in that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To answer your question:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;The exception thrown when this code is run explains that there must be at least degree + 1 control points.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Since the degree passed in is 3, this code violates that rule.&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Revit’s version of creating splines is NurbSpline.Create(&amp;lt;&amp;lt;control points&amp;gt;&amp;gt;, &amp;lt;&amp;lt;weights&amp;gt;&amp;gt;).&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;It automatically sets the degree based on the number of points as described in&amp;nbsp;this internal comment:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;// Use degree 1 for two CPs, degree 2 for three CPs, and degree 3 for four or more CPs.&lt;/PRE&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p2"&gt;Best regards,&lt;/P&gt;
&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p2"&gt;Jeremy&lt;/P&gt;
&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 May 2015 10:57:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/nurbspline-creation-error/m-p/5653109#M72201</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2015-05-27T10:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: NurbSpline Creation Error</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/nurbspline-creation-error/m-p/5654352#M72202</link>
      <description>&lt;P&gt;Thank you for your answer!&lt;BR /&gt;&lt;BR /&gt;I wanted to represent a curve of 3 Control points such arch. then an&amp;nbsp;error&amp;nbsp;message was&amp;nbsp;generated.&amp;nbsp;Please see the attached pictures.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 May 2015 22:10:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/nurbspline-creation-error/m-p/5654352#M72202</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-27T22:10:09Z</dc:date>
    </item>
  </channel>
</rss>

