<?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: drawing in a &amp;quot;section&amp;quot; view in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/drawing-in-a-quot-section-quot-view/m-p/5912168#M69682</link>
    <description>&lt;P&gt;so, did you just change this line in the example???&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;from:&lt;/P&gt;&lt;P&gt;Dim normal As New XYZ(1, 1, 0)&lt;/P&gt;&lt;P&gt;to:&lt;/P&gt;&lt;P&gt;Dim normal As New XYZ(0, 0, 1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;either way, it produces the same error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 17 Nov 2015 16:58:58 GMT</pubDate>
    <dc:creator>bcampbell11</dc:creator>
    <dc:date>2015-11-17T16:58:58Z</dc:date>
    <item>
      <title>drawing in a "section" view</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/drawing-in-a-quot-section-quot-view/m-p/5878773#M69675</link>
      <description>&lt;P&gt;ok, I have been stuck on something for quite a while now, sorry if it is a newby question. &amp;nbsp;When wanting to draw a line via the Revit api, all works perfect as long as the view is a drafting view. &amp;nbsp;How can I draw in a section or elevation without having to figure out what direction I am looking for the x,y,z? &amp;nbsp;How do you make the current view "normal" to where x is to the right and y is up the page? &amp;nbsp;Any thoughts?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!!&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2015 19:58:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/drawing-in-a-quot-section-quot-view/m-p/5878773#M69675</guid>
      <dc:creator>bcampbell11</dc:creator>
      <dc:date>2015-10-26T19:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: drawing in a "section" view</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/drawing-in-a-quot-section-quot-view/m-p/5884357#M69676</link>
      <description>If you have XYZ coordinates, it should work on any view, unless you change what's visible. &lt;BR /&gt;&lt;BR /&gt;Is it a model line?</description>
      <pubDate>Thu, 29 Oct 2015 17:42:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/drawing-in-a-quot-section-quot-view/m-p/5884357#M69676</guid>
      <dc:creator>augusto.goncalves</dc:creator>
      <dc:date>2015-10-29T17:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: drawing in a "section" view</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/drawing-in-a-quot-section-quot-view/m-p/5894465#M69677</link>
      <description>&lt;P&gt;these are model lines. &amp;nbsp;So are you saying, no matter how the section is cut, X should always be to the right, and Y should always be&amp;nbsp;up? &amp;nbsp;I that is the case, I am missing something, when I cut a section and draw a line via .net, XY and Z are different depending on which way the section cut is looking.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;would detail lines behave better?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2015 16:12:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/drawing-in-a-quot-section-quot-view/m-p/5894465#M69677</guid>
      <dc:creator>bcampbell11</dc:creator>
      <dc:date>2015-11-05T16:12:14Z</dc:date>
    </item>
    <item>
      <title>Re: drawing in a "section" view</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/drawing-in-a-quot-section-quot-view/m-p/5894836#M69678</link>
      <description>Maybe I missing something on your question... can you append a few lines where you create it?&lt;BR /&gt;&lt;BR /&gt;The Model Line should have "absolute" XYZ coordinates, but are bound to a sketch plane. Now the Detail Line are bound to a specific view.</description>
      <pubDate>Thu, 05 Nov 2015 18:44:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/drawing-in-a-quot-section-quot-view/m-p/5894836#M69678</guid>
      <dc:creator>augusto.goncalves</dc:creator>
      <dc:date>2015-11-05T18:44:31Z</dc:date>
    </item>
    <item>
      <title>Re: drawing in a "section" view</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/drawing-in-a-quot-section-quot-view/m-p/5902738#M69679</link>
      <description>&lt;P&gt;Hi bcampbell,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;as far as I understand your question, you just want to draw lines in a 2D context, as if using GDI methods.&lt;/P&gt;&lt;P&gt;It is okay to ignore the Z value in drafting views (using value 0 for it) since those views reside in a XY plane on elevation 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In elevation views and section views, you are forced to use the &lt;EM&gt;transformed&lt;/EM&gt; geometry of your proposed lines.&lt;/P&gt;&lt;P&gt;This means you need to calculate the transform of your target view, using its origin and up, right and view direction vectors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Revitalizer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2015 12:39:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/drawing-in-a-quot-section-quot-view/m-p/5902738#M69679</guid>
      <dc:creator>Revitalizer</dc:creator>
      <dc:date>2015-11-11T12:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: drawing in a "section" view</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/drawing-in-a-quot-section-quot-view/m-p/5910739#M69680</link>
      <description>&lt;P&gt;I have done some pretty cool things with the Revit api (in my opinion) but to simply draw a line seems to be one of the most difficult things you can do with the Revit API (Autocad is much much easier). &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lets try a model line, could you explain to me why&amp;nbsp;even&amp;nbsp;trying to get the example below from the SDK tells me "Curve must be in the plane". &amp;nbsp;and by "absolute" do you mean anywhere in the model, looking any direction, I can a line that goes up and to the right with the same coordinates? &amp;nbsp;Not a lot of good resources out there for this kind of thing unfortunately, hard to learn.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;' get handle to application from document&lt;BR /&gt;Dim application As Autodesk.Revit.ApplicationServices.Application = document.Application&lt;/P&gt;&lt;P&gt;' Create a geometry line in Revit application&lt;BR /&gt;Dim startPoint As New XYZ(0, 0, 0)&lt;BR /&gt;Dim endPoint As New XYZ(10, 10, 0)&lt;BR /&gt;Dim geomLine As Line = Line.CreateBound(startPoint, endPoint)&lt;/P&gt;&lt;P&gt;' Create a geometry arc in Revit application&lt;BR /&gt;Dim end0 As New XYZ(1, 0, 0)&lt;BR /&gt;Dim end1 As New XYZ(10, 10, 10)&lt;BR /&gt;Dim pointOnCurve As New XYZ(10, 0, 0)&lt;BR /&gt;Dim geomArc As Arc = Arc.Create(end0, end1, pointOnCurve)&lt;/P&gt;&lt;P&gt;' Create a geometry plane in Revit application&lt;BR /&gt;Dim origin As New XYZ(0, 0, 0)&lt;BR /&gt;Dim normal As New XYZ(1, 1, 0)&lt;BR /&gt;Dim geomPlane As Plane = application.Create.NewPlane(normal, origin)&lt;/P&gt;&lt;P&gt;' Create a sketch plane in current document&lt;BR /&gt;Dim sketch As SketchPlane = SketchPlane.Create(document, geomPlane)&lt;/P&gt;&lt;P&gt;' Create a ModelLine element using the created geometry line and sketch plane&lt;BR /&gt;Dim line__1 As ModelLine = TryCast(document.Create.NewModelCurve(geomLine, sketch), ModelLine)&lt;/P&gt;&lt;P&gt;' Create a ModelArc element using the created geometry arc and sketch plane&lt;/P&gt;</description>
      <pubDate>Mon, 16 Nov 2015 22:10:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/drawing-in-a-quot-section-quot-view/m-p/5910739#M69680</guid>
      <dc:creator>bcampbell11</dc:creator>
      <dc:date>2015-11-16T22:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: drawing in a "section" view</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/drawing-in-a-quot-section-quot-view/m-p/5911500#M69681</link>
      <description>For a line like this, that lies on the XY plane (Z=0), the SketchPlane should be on the same plane&lt;BR /&gt;&lt;BR /&gt;Dim startPoint As New XYZ(0, 0, 0)&lt;BR /&gt;Dim endPoint As New XYZ(10, 10, 0)&lt;BR /&gt;Dim geomLine As Line = Line.CreateBound(startPoint, endPoint)&lt;BR /&gt;&lt;BR /&gt;Dim origin As New XYZ(0, 0, 0)&lt;BR /&gt;Dim normal As New XYZ(0, 0, 1) ' vector in Z&lt;BR /&gt;Dim geomPlane As Plane = application.Create.NewPlane(normal, origin)</description>
      <pubDate>Tue, 17 Nov 2015 11:00:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/drawing-in-a-quot-section-quot-view/m-p/5911500#M69681</guid>
      <dc:creator>augusto.goncalves</dc:creator>
      <dc:date>2015-11-17T11:00:22Z</dc:date>
    </item>
    <item>
      <title>Re: drawing in a "section" view</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/drawing-in-a-quot-section-quot-view/m-p/5912168#M69682</link>
      <description>&lt;P&gt;so, did you just change this line in the example???&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;from:&lt;/P&gt;&lt;P&gt;Dim normal As New XYZ(1, 1, 0)&lt;/P&gt;&lt;P&gt;to:&lt;/P&gt;&lt;P&gt;Dim normal As New XYZ(0, 0, 1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;either way, it produces the same error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2015 16:58:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/drawing-in-a-quot-section-quot-view/m-p/5912168#M69682</guid>
      <dc:creator>bcampbell11</dc:creator>
      <dc:date>2015-11-17T16:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: drawing in a "section" view</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/drawing-in-a-quot-section-quot-view/m-p/5912258#M69683</link>
      <description>&lt;P&gt;This code works for your model line:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;XYZ origin = new XYZ(0, 0, 0);
XYZ normal = new XYZ(0, 0, 1);
Plane plane = app.Create.NewPlane(normal, origin);
SketchPlane skplane = SketchPlane.Create(doc, plane);

XYZ startPoint = new XYZ(0, 0, 0);
XYZ endPoint = new XYZ(10, 10, 0);
Line l = Line.CreateBound(startPoint, endPoint);
ModelLine ml = doc.Create.NewModelCurve(l, skplane) as ModelLine;&lt;/PRE&gt;
&lt;P&gt;Now your code for arc is a bit different as the points are in a more complex scenario... so let's try a more generic approach with CrossProduct from end1 and pointOnCurve and using end0 as origin for the plane&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;XYZ end0 = new XYZ(1, 0, 0);
XYZ end1 = new XYZ(10, 10, 10);
XYZ pointOnCurve = new XYZ(10, 0, 0);
Arc a = Arc.Create(end0, end1, pointOnCurve);

XYZ origin = end0;
XYZ normal = end1.CrossProduct(pointOnCurve);
Plane plane = app.Create.NewPlane(normal, origin);

SketchPlane skplane = SketchPlane.Create(doc, plane);
ModelArc ml = doc.Create.NewModelCurve(a, skplane) as ModelArc;&lt;/PRE&gt;
&lt;P&gt;And I hope my math is ok &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;Form wikipedia, just in case:&amp;nbsp;&lt;A href="https://en.wikipedia.org/wiki/Cross_product" target="_blank"&gt;https://en.wikipedia.org/wiki/Cross_product&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/201247iE4C283DA56C6B9D7/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="220px-Right_hand_rule_cross_product.svg.png" title="220px-Right_hand_rule_cross_product.svg.png" /&gt;&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 class="p1"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2015 17:38:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/drawing-in-a-quot-section-quot-view/m-p/5912258#M69683</guid>
      <dc:creator>augusto.goncalves</dc:creator>
      <dc:date>2015-11-17T17:38:25Z</dc:date>
    </item>
    <item>
      <title>Re: drawing in a "section" view</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/drawing-in-a-quot-section-quot-view/m-p/8036869#M69684</link>
      <description>&lt;P&gt;I know this is an old post, but I wonder if you found the way to get point XYZ (start and end) for the detail line to always match the viewplane (to draw on the view plane)?&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 01:55:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/drawing-in-a-quot-section-quot-view/m-p/8036869#M69684</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-05-31T01:55:59Z</dc:date>
    </item>
    <item>
      <title>Re: drawing in a "section" view</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/drawing-in-a-quot-section-quot-view/m-p/11605155#M69685</link>
      <description>&lt;P&gt;&lt;A href="https://thebuildingcoder.typepad.com/blog/2010/05/detail-curve-must-indeed-lie-in-plane.html" target="_blank"&gt;https://thebuildingcoder.typepad.com/blog/2010/05/detail-curve-must-indeed-lie-in-plane.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2022 22:07:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/drawing-in-a-quot-section-quot-view/m-p/11605155#M69685</guid>
      <dc:creator>FrankHolidaytoiling</dc:creator>
      <dc:date>2022-12-07T22:07:14Z</dc:date>
    </item>
  </channel>
</rss>

