<?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: Something thats getting on my NURBS in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/something-thats-getting-on-my-nurbs/m-p/5429032#M74831</link>
    <description>&lt;P&gt;Dear David,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I heard back from the development team, and they say:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It looks like the problem is not with creating the 3D NURBS, it's with using them for the purpose of creating a Revit element. Are you creating a curve-driven family instance? We can only guess by looking at the error message, although you don't explicitly mention the code that results in the error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might be able to do it by creating the geometry directly in a family. For example, use the Mass family element NewLoftForm or NewSweptBlendForm creation routines.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;</description>
    <pubDate>Mon, 01 Dec 2014 17:35:42 GMT</pubDate>
    <dc:creator>jeremytammik</dc:creator>
    <dc:date>2014-12-01T17:35:42Z</dc:date>
    <item>
      <title>Something thats getting on my NURBS</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/something-thats-getting-on-my-nurbs/m-p/5425585#M74829</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For fun and educational purposes I'm trying to create a little application that will let the users build a little bridge over a river.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The structural members I want to generate using a formula, any custom formula a user tweeks.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now to "build"&amp;nbsp;this bridge in Revit I am now trying to find the right approach to put this into code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;First choise would be using nurbsplines.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found this bit of link of course:&lt;/P&gt;&lt;P&gt;&lt;A target="_self" href="http://thebuildingcoder.typepad.com/blog/2009/06/creating-a-curved-beam.html"&gt;http://thebuildingcoder.typepad.com/blog/2009/06/creating-a-curved-beam.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the links that it refers to, are interesting links...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In any ways, the link refers to 2009 and after this not much has been written on the nurbspline class....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I created this little code.&lt;/P&gt;&lt;P&gt;which creates the arch as shown below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Curve c = CreateNurbSpline(doc);
FamilyInstance inst =
   doc.Create.NewFamilyInstance(
   c,
   targetElems.ElementAt(0),
   level,
   StructuralType.Beam);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Then:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;        NurbSpline CreateNurbSpline(Document doc)
        {
            //Appvars
            int n = 80;
            double length = 25000 / ft;
            double width = 5000 / ft;

            IList&amp;lt;XYZ&amp;gt; PointsList = new List&amp;lt;XYZ&amp;gt;();
            IList&amp;lt;double&amp;gt; WeightList = new List&amp;lt;double&amp;gt;();

            //StartingSubPoint taken from insertionpoint family
            XYZ p1 = new XYZ(
                    StartingSubPoint.X + 25, //Offset might be required
                    StartingSubPoint.Y,
                    StartingSubPoint.Z);

            //XYZ CurrentPoint = StartingSubPoint;
            PointsList.Add(p1);
            WeightList.Add(1);

            for (int i = 0; i &amp;lt; n; i++)
            {
                //Repeat untill end of formula is reached.(creates n-1 points)
                XYZ p2 = new XYZ(
                    p1.X + (width / n), //works
                    //StartingSubPoint.X + Math.Sin(a) * 2, //doesnt work
                    p1.Y + (length / n), //works
                    StartingSubPoint.Z + Math.Sin(a) * 10);

                //Add Controlpoint to list
                PointsList.Add(p2);
                WeightList.Add(1);

                //Start from where we left for the next round
                p1 = p2;

                //Next point on curve we only run "top curve of sin formula"
                a += ((Math.PI) / n);
            }

            NurbSpline detailNurbSpline
              = NurbSpline.Create(PointsList, WeightList);

            return detailNurbSpline;

        }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However all the examples, and the code above&amp;nbsp;create a 2D Nurbsplines,&lt;/P&gt;&lt;P&gt;I would like to be able to shape my arches in three dimensions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this at all possible using Nurbs? Nowhere I can find&amp;nbsp;that I cant.&lt;/P&gt;&lt;P&gt;if I replace the part:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;p1.X + (width / n), //works&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;with:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;StartingSubPoint.X + Math.Sin(a) * 2,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the loop will run over two axes creating 3 dimensional spline.&lt;/P&gt;&lt;P&gt;If I try I get this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/143458i81C9C03659081957/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" title="Error.jpg" alt="Error.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;----------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can build the arch using short segments of staight lines, and I am able to more freely build lines as shown below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/143462i73D8597D0E367402/image-size/large?v=mpbl-1&amp;amp;px=-1" border="0" title="Isometric View On Sweeps.jpg" alt="Isometric View On Sweeps.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/143461i9D401EB8E78CB4C4/image-size/medium?v=mpbl-1&amp;amp;px=-1" border="0" title="Top View On Sweeps.jpg" alt="Top View On Sweeps.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But this takes much longer and often create problems when the beams&amp;nbsp;join.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So is there a way to create a 3D Nurb (meaning using all three axes)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Nov 2014 17:36:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/something-thats-getting-on-my-nurbs/m-p/5425585#M74829</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-11-26T17:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: Something thats getting on my NURBS</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/something-thats-getting-on-my-nurbs/m-p/5426484#M74830</link>
      <description>&lt;P&gt;Dear David,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for you nice and interesting query.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am checking with the development team.&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>Thu, 27 Nov 2014 12:10:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/something-thats-getting-on-my-nurbs/m-p/5426484#M74830</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2014-11-27T12:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: Something thats getting on my NURBS</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/something-thats-getting-on-my-nurbs/m-p/5429032#M74831</link>
      <description>&lt;P&gt;Dear David,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I heard back from the development team, and they say:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It looks like the problem is not with creating the 3D NURBS, it's with using them for the purpose of creating a Revit element. Are you creating a curve-driven family instance? We can only guess by looking at the error message, although you don't explicitly mention the code that results in the error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might be able to do it by creating the geometry directly in a family. For example, use the Mass family element NewLoftForm or NewSweptBlendForm creation routines.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;</description>
      <pubDate>Mon, 01 Dec 2014 17:35:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/something-thats-getting-on-my-nurbs/m-p/5429032#M74831</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2014-12-01T17:35:42Z</dc:date>
    </item>
  </channel>
</rss>

