<?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: Projection Transformation in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/9119247#M38956</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;there is a workaround for the projection of curves to a plane.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From your curves, create ModelCurves.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Depending on context (project or family), you can create DetailCurves or SymbolicCurves in a given view.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Document.ConvertModelToDetailCurves or&lt;/P&gt;&lt;P&gt;Document.ConvertModelToSymbolicCurves&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the RevitAPI.chm, it says in the text:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV class="saveHistory"&gt;&lt;DIV class="section"&gt;&lt;DIV&gt;"The lines are projected on the view plane. If the lines are not parallel to the view plane, lines are foreshortened and arcs are converted to ellipses. Splines are modified."&lt;P&gt;Get the DetailCurve.GeometryCurve from the resulting elements and your are done.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since you cannot create (2D) views for arbitrary planes but for vertical or horizontal ones only, this workaround is limited.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Revitalizer&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 31 Oct 2019 10:15:55 GMT</pubDate>
    <dc:creator>Revitalizer</dc:creator>
    <dc:date>2019-10-31T10:15:55Z</dc:date>
    <item>
      <title>Projection Transformation</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/9114980#M38951</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am relative new to revit api and was looking into transformations, trying to use them to project geometry (a curve) onto a plane. This should come out of the box, so I thought.&lt;BR /&gt;&lt;BR /&gt;When apllying the following transformation&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1,0,0,0&lt;/P&gt;&lt;P&gt;0,1,0,0&lt;/P&gt;&lt;P&gt;0,0,0,0&lt;/P&gt;&lt;P&gt;0,0,0,1 // for completness&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to a curve I get a "transform is not conformal" error.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Is there any way to do this in revit or do I need to reinvent the wheel and write the transformations for each curve type myself?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Richard&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2019 15:06:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/9114980#M38951</guid>
      <dc:creator>richard.schaffranek</dc:creator>
      <dc:date>2019-10-29T15:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: Projection Transformation</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/9115321#M38952</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Dear Richard,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I guess I said most of what I have to say on this in my answers to your comments on The Building Coder:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2008/12/polygon-transformation.html#comment-4669997409" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2008/12/polygon-transformation.html#comment-4669997409&lt;/A&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2008/12/polygon-transformation.html#comment-4670106610" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2008/12/polygon-transformation.html#comment-4670106610&lt;/A&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Using such a projection is obviously a good idea, in principle.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;However, Revit transformations are built for BIM purposes.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You cannot apply a non-conformal transformation to a door or window and still expect it to comply with the building codes and standards.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;So, how to project your 3D curve to 2D depends on what you want to achieve and do with it.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you can live with an approximation, I would suggest you tessellate the curve.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;That produces a series of line segments, and those are easy to project any way you like.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If that is not an option and you need precise curve results, I am indeed afraid you might have to write the transformations for each curve type yourself.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Alternatively, you might be able to hook up with some external geometric library that can support you in that transformation.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I have researched that topic briefly multiple times, and all the 3D libraries that I looked at were rather large and complex for my immediate needs.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;However, I think any good reliable powerful library that you can connect will do the job.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;So, I have no specific preference in that area. There are a huge number of them out there, some are immensely powerful, some are good and relatively unknown. Several CAD vendors have open-sourced significant libraries.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Please do let us know how you end up solving this.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Jeremy&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2019 17:11:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/9115321#M38952</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2019-10-29T17:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: Projection Transformation</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/9117173#M38953</link>
      <description>&lt;P&gt;Well I went the long way and wrote projection methodes for all curve types (except CylindricalHelix ), as for lines it is straight forward, but I am not so sure with hermitSplines / NurbsSplines, maybe someone could comment on that, maybe there are problems I have missed...&lt;BR /&gt;&lt;BR /&gt;I have tested it for some occations and two things that happened where:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;a) projected curves where longer than edges of faces from which they where generated...&lt;/P&gt;&lt;P&gt;b) projected hermitSplines didn't rebuild correctly, which might be becaus you can only define start / end tangents and not the complete list when creating a curve.&lt;/P&gt;&lt;P&gt;c) Ellipse.createcurve() is a little too clever since it will create an arc if the two radius are equal... -&amp;gt; resulted in a endless loop...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;        private static Curve Project(Autodesk.Revit.DB.NurbSpline nurbsSpline, Autodesk.Revit.DB.Plane plane)
        {

            XYZ[] controlPoints = GeometryHelper.ProjectPoint(nurbsSpline.CtrlPoints, plane);
            double[] knots = new double[nurbsSpline.Knots.Size];
            for(int i = 0; i &amp;lt; knots.Length;i++)
            {
                knots[i] = nurbsSpline.Knots.get_Item(i);
            }
            double[] weights = new double[nurbsSpline.Weights.Size];
            for (int i = 0; i &amp;lt; weights.Length; i++)
            {
                weights[i] = nurbsSpline.Weights.get_Item(i);
            }
            return NurbSpline.CreateCurve(nurbsSpline.Degree, knots,  controlPoints, weights);
         }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;        private static Curve Project(Autodesk.Revit.DB.HermiteSpline hermiteSpline, Autodesk.Revit.DB.Plane plane)
        { 
            XYZ[] tangents= GeometryHelper.ProjectVector(hermiteSpline.Tangents,plane);
            XYZ[] controlPoints = GeometryHelper.ProjectPoint(hermiteSpline.ControlPoints, plane);
            HermiteSplineTangents hermiteSplineTangents = new HermiteSplineTangents() { StartTangent = tangents[0].Normalize(),EndTangent = tangents[tangents.Length - 1].Normalize() };
            return HermiteSpline.Create(controlPoints, hermiteSpline.IsPeriodic, hermiteSplineTangents);
        }&lt;/PRE&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, 30 Oct 2019 13:49:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/9117173#M38953</guid>
      <dc:creator>richard.schaffranek</dc:creator>
      <dc:date>2019-10-30T13:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: Projection Transformation</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/9117940#M38954</link>
      <description>&lt;P&gt;Well done! Sounds like pretty good progress. I cannot say anything off-hand about the issues you observed, though, so I passed on your questions to the development team for you. I hope to hear back from them soon.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2019 17:57:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/9117940#M38954</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2019-10-30T17:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: Projection Transformation</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/9119225#M38955</link>
      <description>&lt;P&gt;Feedback so far from the development team:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="c-message_kit__text" data-qa="text-atom"&gt;If Revit's public API does not include a function to project a curve to a plane (or more generally, to a surface), and it looks like it doesn't, you can request that such a function be added. This wouldn't be done immediately. Note that there are various complications - the curve may project to a self-intersecting curve, or one with singularities such as cusps, or to a degenerate curve (a point), and such curves may cause downstream problems. For projecting a curve onto a surface, part of the curve may miss the surface when projected, and one might want to distinguish between projecting orthogonal to the surface and projecting along a given direction.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="c-message_kit__text" data-qa="text-atom"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="c-message_kit__text" data-qa="text-atom"&gt;You could file a wish list item for this in the Revit Idea Station and ensure it gets many votes. However, it would take time to plan and implement, of course.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="c-message_kit__text" data-qa="text-atom"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="c-message_kit__text" data-qa="text-atom"&gt;I'll let you know if they add anything else, e.g., take a look at and comment on your sample code.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="c-message_kit__text" data-qa="text-atom"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 10:06:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/9119225#M38955</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2019-10-31T10:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: Projection Transformation</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/9119247#M38956</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;there is a workaround for the projection of curves to a plane.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From your curves, create ModelCurves.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Depending on context (project or family), you can create DetailCurves or SymbolicCurves in a given view.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Document.ConvertModelToDetailCurves or&lt;/P&gt;&lt;P&gt;Document.ConvertModelToSymbolicCurves&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the RevitAPI.chm, it says in the text:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV class="saveHistory"&gt;&lt;DIV class="section"&gt;&lt;DIV&gt;"The lines are projected on the view plane. If the lines are not parallel to the view plane, lines are foreshortened and arcs are converted to ellipses. Splines are modified."&lt;P&gt;Get the DetailCurve.GeometryCurve from the resulting elements and your are done.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since you cannot create (2D) views for arbitrary planes but for vertical or horizontal ones only, this workaround is limited.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Revitalizer&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 31 Oct 2019 10:15:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/9119247#M38956</guid>
      <dc:creator>Revitalizer</dc:creator>
      <dc:date>2019-10-31T10:15:55Z</dc:date>
    </item>
    <item>
      <title>Re: Projection Transformation</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/9119258#M38957</link>
      <description>&lt;P&gt;Thanks for the effort, dont't get me wrong when saying this, I doubt that something is going to happen...&amp;nbsp; but I had a little conversation incuding a wish for Inventor a while ago. It wasn't accepting surface generated from another program&amp;nbsp; (Rhino3d) for unrolling them even so I got the feedback that the surface was perfectly developable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So that didn't change...&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>Thu, 31 Oct 2019 10:19:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/9119258#M38957</guid>
      <dc:creator>richard.schaffranek</dc:creator>
      <dc:date>2019-10-31T10:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: Projection Transformation</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/9119270#M38958</link>
      <description>&lt;P&gt;Wow, Rudi, absolutely brilliant!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you really want to work around the restriction to horizontal and vertical planes, you can add another twist (plus reverse twist) to the process as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Apply a suitable transformation to the curve before converting it to a model line&lt;/LI&gt;
&lt;LI&gt;Project the model line onto a horizontal or vertical plane&lt;/LI&gt;
&lt;LI&gt;Apply the reverse transformation to the horizontal or vertical planar result to get it positioned where you want it&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Haha!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 10:26:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/9119270#M38958</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2019-10-31T10:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: Projection Transformation</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/9119303#M38959</link>
      <description>&lt;P&gt;Hi Jeremy,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;simple task, surprising workaround - that's Revit API at its best.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That would be a nice entry for your blog.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rudi&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 10:36:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/9119303#M38959</guid>
      <dc:creator>Revitalizer</dc:creator>
      <dc:date>2019-10-31T10:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: Projection Transformation</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/9119393#M38960</link>
      <description>&lt;P&gt;Definitly a thing to try out. I had some issues with preciosion and further boolean operations with my projection algorithm, I am wondering if this is a more precise way to do so?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have to test.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 11:15:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/9119393#M38960</guid>
      <dc:creator>richard.schaffranek</dc:creator>
      <dc:date>2019-10-31T11:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: Projection Transformation</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/9119445#M38961</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;as for precision, I think that there may be inaccuracies, due to the fact that we create elements (which react to other elements, views etc.).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Revit's AI may adjust elements according to its will.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, further limitations are apparent.&lt;/P&gt;&lt;P&gt;There is a ShortCurveTolerance constant, "the enforced minimum length for any curve created by Revit", as the documentation says.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the conversion methods will fail if a projected result would contain such a curve.&lt;/P&gt;&lt;P&gt;Imagine a line in the plane's normal direction - it would result in a point on the plane.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But after all, I didn't try this myself.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You could project some control points to the plane (start point, end point) and check the projected curves' related points.&lt;/P&gt;&lt;P&gt;So you could get a tolerance value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Revitalizer&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 11:44:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/9119445#M38961</guid>
      <dc:creator>Revitalizer</dc:creator>
      <dc:date>2019-10-31T11:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: Projection Transformation</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/9119484#M38962</link>
      <description>&lt;P&gt;Will give it a try, but might stick to my implmenetation, at least I know were the inprecision is...&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 11:59:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/9119484#M38962</guid>
      <dc:creator>richard.schaffranek</dc:creator>
      <dc:date>2019-10-31T11:59:27Z</dc:date>
    </item>
    <item>
      <title>Re: Projection Transformation</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/9120822#M38963</link>
      <description>&lt;P&gt;It would be absolutely great if you could share your current implementation with all its imprecision aspects documented plus the results of testing Rudi's suggestion. That would be awesome material for a nicely rounded-off discussion by The Building Coder. Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 21:01:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/9120822#M38963</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2019-10-31T21:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: Projection Transformation</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/9122268#M38964</link>
      <description>&lt;P&gt;Here is a comment from the development team on your projection implementation:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="c-message_kit__gutter__right"&gt;&lt;SPAN class="c-message_kit__text" data-qa="text-atom"&gt;In the second function, which projects a Hermite spline curve onto a plane, the user should not normalise the tangent vectors. The lengths of the start and end tangent vectors (i.e., first derivatives) affect the shape of the spline curve.The first function, which projects Nurbs spline curves onto a plane, looks correct. The user didn't seem to indicate any problems with that function, but if I misunderstood, let me know. The fact that the Ellipse constructor will create an Arc if the ellipse happens to be circular is intentional, because Revit expects curves and surfaces to be represented in the simplest possible form, with an arc being considered simpler than an ellipse. I don't know what the user's first comment means ("projected curves where longer than edges of faces from which they where generated").&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="c-message_kit__gutter__right"&gt;&lt;SPAN class="c-message_kit__text" data-qa="text-atom"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="c-message_kit__gutter__right"&gt;&lt;SPAN class="c-message_kit__text" data-qa="text-atom"&gt;I hope this helps.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="c-message_kit__gutter__right"&gt;&lt;SPAN class="c-message_kit__text" data-qa="text-atom"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 01 Nov 2019 15:26:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/9122268#M38964</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2019-11-01T15:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: Projection Transformation</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/9127296#M38965</link>
      <description>&lt;P&gt;Some more feedback from the development team on the ideas discussed above:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Regarding Document.ConvertModelToDetailCurves and Document.ConvertModelToSymbolicCurves: the user should be aware that if they produce curves that Revit considers invalid, such as self-intersecting curves or zero-length curves, they may cause problems if they're used in creating Revit geometry (or in other contexts for that matter). However, a&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;quick look at the internal function those API functions call indicates that it does check if the projection curve (i.e., the result) would have singularities or self-intersections and does not return a result in such cases. So, I would guess that the same is true for the two API functions.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Note, too, that there are cases when users might want to allow the projection curve to be self-intersecting. For example, if a full circle lying in a vertical plane is projected to a horizontal plane, some users might want that operation to succeed and to return a line segment representing the "shadow" of the circle (as if the sun were directly overhead). I don't believe the Revit API provides such a function.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2019 07:34:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/9127296#M38965</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2019-11-05T07:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: Projection Transformation</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/9132489#M38966</link>
      <description>&lt;P&gt;Dear Richard,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How did you end up solving this, please, so we can wrap it up?&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;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 09:05:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/9132489#M38966</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2019-11-07T09:05:31Z</dc:date>
    </item>
    <item>
      <title>Re: Projection Transformation</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/11927791#M38967</link>
      <description>&lt;P&gt;&lt;EM&gt;Dear Jeremy, I have written several methods for projecting points on a plane and visualizing the calculated geometry, for a better understanding of what is happening&lt;BR /&gt;&lt;BR /&gt;A method of projecting a point onto a plane defined by two points p1 and p2&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public static XYZ PointAtPlane(XYZ point, XYZ start, XYZ end)
        {
            // Find the vector "v" between the start and end points:
            XYZ v = end - start;
            // Find the unit vector "n" of the normal to the plane passing through the given start and end points:
            XYZ n = v.Normalize();
            // Find the vector "u" from the center of the plane start to a given point point:
            XYZ u = point - start;
            // Find the distance "d" from the center of the plane to the projection of the point point on the plane:
            double d = u.DotProduct(n);
            // Find the projection p of a given point point on a plane:
            XYZ result = point - d * n;
            return result;
        }&lt;/LI-CODE&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;BR /&gt;This method creates a square in the plane of the facade "In front"&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;//This method creates a square in the plane of the facade "In front"
public static List&amp;lt;XYZ&amp;gt; CreateRect(double hight, double wight)
        {
            return new List&amp;lt;XYZ&amp;gt;
            {
                new XYZ(-wight / 2, 0, hight / 2), // leftUp
                new XYZ(wight / 2, 0, hight / 2), // rightUp
                new XYZ(wight / 2, 0, -hight / 2), // rightDown
                new XYZ(-wight / 2, 0, -hight / 2) // leftDown
            };
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Next, using the Create Model Line method (described below), we draw lines in the model that visualize all the vectors of the points used.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public static List&amp;lt;XYZ&amp;gt; CreateVisual(XYZ p1, XYZ p2, List&amp;lt;XYZ&amp;gt; listPoint)
        {
            Element red = Main.Doc.GetElement(new ElementId(490985));
            Element orange = Main.Doc.GetElement(new ElementId(421355));
            Element green = Main.Doc.GetElement(new ElementId(78));

            CreateModelLine(Main.Doc, p1, p2, red);
            List&amp;lt;XYZ&amp;gt; lPtAtPl = new List&amp;lt;XYZ&amp;gt;();
            foreach (XYZ point in listPoint)
            {
                CreateModelLine(Main.Doc, XYZ.Zero, point, orange);
                XYZ p = PointAtPlane(point, p1, p2);
                CreateModelLine(Main.Doc, XYZ.Zero, p, green);
                lPtAtPl.Add(p);
            }
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The "red" line style is used to display the line that defines the normal of the plane on which the point vectors of the previously created rectangle should be projected. The orange line style displays the point vectors of the original rectangle. The blue lines represent just the projection vectors of the points of the original rectangle on the plane specified by points p1 and p2&lt;BR /&gt;Demonstration of the projection of the rectangle createRect(10, 10) and the plane defined by the points new XYZ(0,0,0) and new XYZ(1, 2, 2)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ankofl_0-1682669915486.png" style="width: 219px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1207852i6C8ED4029C69D12D/image-dimensions/219x220?v=v2" width="219" height="220" role="button" title="ankofl_0-1682669915486.png" alt="ankofl_0-1682669915486.png" /&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ankofl_1-1682670273077.png" style="width: 219px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1207854iB9B76E96445148CA/image-dimensions/219x219?v=v2" width="219" height="219" role="button" title="ankofl_1-1682670273077.png" alt="ankofl_1-1682670273077.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The ModelCurve creation method is described below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public static ModelCurve CreateModelLine(Document Doc, XYZ start, XYZ end, Element lineStyle)
        {
            ModelCurve modelLine = null;
            try
            {
                Line geomLine = Line.CreateBound(start, end);

                XYZ lineDirection = end - start;

                XYZ normal = lineDirection.CrossProduct(XYZ.BasisZ).Normalize();

                if (normal.IsZeroLength())
                {
                    normal = lineDirection.CrossProduct(XYZ.BasisY).Normalize();

                    if (normal.IsZeroLength())
                    {
                        normal = lineDirection.CrossProduct(XYZ.BasisX).Normalize();
                    }
                }

                Plane plane = Plane.CreateByNormalAndOrigin(normal, start);

                Plane geomPlane = Plane.CreateByNormalAndOrigin(plane.Normal, start);

                SketchPlane sketch = SketchPlane.Create(Doc, geomPlane);

                modelLine = Doc.Create.NewModelCurve(geomLine, sketch);
                modelLine.LineStyle = lineStyle;
            }
            catch { }
            return modelLine;
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 08:35:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/11927791#M38967</guid>
      <dc:creator>ankofl</dc:creator>
      <dc:date>2023-04-28T08:35:47Z</dc:date>
    </item>
    <item>
      <title>Re: Projection Transformation</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/11927820#M38968</link>
      <description>&lt;P&gt;Thank you for sharing. I am travelling right now. I'll take a closer look asap. Meanwhile, can you compare your methods with similar functions in The Building Coder samples Creator and Util modules?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://github.com/jeremytammik/the_building_coder_samples" target="_blank"&gt;https://github.com/jeremytammik/the_building_coder_samples&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;        /// &amp;lt;summary&amp;gt;
        ///     Project given 3D XYZ point onto plane.
        /// &amp;lt;/summary&amp;gt;
        public static XYZ ProjectOnto(
            this Plane plane,
            XYZ p)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 08:53:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/11927820#M38968</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2023-04-28T08:53:06Z</dc:date>
    </item>
    <item>
      <title>Re: Projection Transformation</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/11927838#M38969</link>
      <description>&lt;P&gt;Thanks for the link, I haven't seen it before. Regarding my solution, I think I have found a more optimal solution that does the work of my PointAtPlane method. It was found in CmdDetailCurves.cs in the BuildingCoder folder by your link&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;private XYZ ProjectPointOntoPlane(
            XYZ point,
            XYZ planeNormal)
        {
            var a = planeNormal.X;
            var b = planeNormal.Y;
            var c = planeNormal.Z;

            var dx = (b * b + c * c) * point.X - a * b * point.Y - a * c * point.Z;
            var dy = -(b * a) * point.X + (a * a + c * c) * point.Y - b * c * point.Z;
            var dz = -(c * a) * point.X - c * b * point.Y + (a * a + b * b) * point.Z;
            return new XYZ(dx, dy, dz);
        }&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 28 Apr 2023 09:00:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/projection-transformation/m-p/11927838#M38969</guid>
      <dc:creator>ankofl</dc:creator>
      <dc:date>2023-04-28T09:00:21Z</dc:date>
    </item>
  </channel>
</rss>

