<?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: How to get SectionView cropbox? in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-sectionview-cropbox/m-p/6433203#M64292</link>
    <description>&lt;P&gt;Dear&amp;nbsp;&lt;SPAN style="font-size: 12.0pt; font-family: 'Arial','sans-serif'; color: #666666;"&gt;Jeremy,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Arial','sans-serif'; color: #666666;"&gt;thanks for your quickly response.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So i need to use&amp;nbsp;Transform object to get&amp;nbsp;coordinate?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My stupid method:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;        Dim bb As BoundingBoxXYZ = MyViewSection.CropBox

        If MyViewSection.ViewDirection.Y = -1 Then 'UP
            minX = MyViewSection.Origin.X - (bb.Max.X - bb.Min.X) / 2
            maxX = MyViewSection.Origin.X + (bb.Max.X - bb.Min.X) / 2
            minY = MyViewSection.Origin.Y
            maxY = MyViewSection.Origin.Y + (bb.Max.Z - bb.Min.Z)
        ElseIf MyViewSection.ViewDirection.Y = 1 Then 'DOWN
            minX = MyViewSection.Origin.X - (bb.Max.X - bb.Min.X) / 2
            maxX = MyViewSection.Origin.X + (bb.Max.X - bb.Min.X) / 2
            minY = MyViewSection.Origin.Y - (bb.Max.Z - bb.Min.Z)
            maxY = MyViewSection.Origin.Y
        ElseIf MyViewSection.ViewDirection.X = -1 Then 'RIGHT
            minX = MyViewSection.Origin.X
            maxX = MyViewSection.Origin.X + (bb.Max.Z - bb.Min.Z)
            minY = MyViewSection.Origin.Y - (bb.Max.X - bb.Min.X) / 2
            maxY = MyViewSection.Origin.Y + (bb.Max.X - bb.Min.X) / 2
        ElseIf MyViewSection.ViewDirection.X = 1 Then 'LEFT
            minX = MyViewSection.Origin.X - (bb.Max.Z - bb.Min.Z)
            maxX = MyViewSection.Origin.X
            minY = MyViewSection.Origin.Y - (bb.Max.X - bb.Min.X) / 2
            maxY = MyViewSection.Origin.Y + (bb.Max.X - bb.Min.X) / 2
        End If&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Jul 2016 09:02:36 GMT</pubDate>
    <dc:creator>pochao</dc:creator>
    <dc:date>2016-07-13T09:02:36Z</dc:date>
    <item>
      <title>How to get SectionView cropbox?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-sectionview-cropbox/m-p/6433152#M64290</link>
      <description>&lt;P&gt;hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can get ViewSection's&amp;nbsp;BoundingBoxXYZ、 Origin、ViewDirection&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But i don't know how to get the CropBox's X,Y (like image dash line)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please help me, thank&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/254722i84BB972EEF9A4E0C/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="擷取.PNG" title="擷取.PNG" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2016 08:18:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-sectionview-cropbox/m-p/6433152#M64290</guid>
      <dc:creator>pochao</dc:creator>
      <dc:date>2016-07-13T08:18:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to get SectionView cropbox?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-sectionview-cropbox/m-p/6433181#M64291</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Dear Pochao,&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 for your query.&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;Here is a discussion of creating a section view that is parallel to and exactly aligned with a selected wall:&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;&lt;A href="http://thebuildingcoder.typepad.com/blog/2012/06/create-section-view-parallel-to-wall.html" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2012/06/create-section-view-parallel-to-wall.html&lt;/A&gt;&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 also includes retrieving and setting the X and Y extents to size and align the view exactly with the wall.&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;The crop box is simply attached to the view.&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;To clarify how to determine the exact crop box X and Y coordinates, this discussion of a Element in View Crop Box Predicate might help:&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;&lt;A href="http://thebuildingcoder.typepad.com/blog/2012/02/element-in-view-crop-box-predicate.html" target="_blank"&gt;http://thebuildingcoder.typepad.com/blog/2012/02/element-in-view-crop-box-predicate.html&lt;/A&gt;&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 hope this helps.&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;</description>
      <pubDate>Wed, 13 Jul 2016 08:48:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-sectionview-cropbox/m-p/6433181#M64291</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2016-07-13T08:48:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to get SectionView cropbox?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-sectionview-cropbox/m-p/6433203#M64292</link>
      <description>&lt;P&gt;Dear&amp;nbsp;&lt;SPAN style="font-size: 12.0pt; font-family: 'Arial','sans-serif'; color: #666666;"&gt;Jeremy,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Arial','sans-serif'; color: #666666;"&gt;thanks for your quickly response.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So i need to use&amp;nbsp;Transform object to get&amp;nbsp;coordinate?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My stupid method:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;        Dim bb As BoundingBoxXYZ = MyViewSection.CropBox

        If MyViewSection.ViewDirection.Y = -1 Then 'UP
            minX = MyViewSection.Origin.X - (bb.Max.X - bb.Min.X) / 2
            maxX = MyViewSection.Origin.X + (bb.Max.X - bb.Min.X) / 2
            minY = MyViewSection.Origin.Y
            maxY = MyViewSection.Origin.Y + (bb.Max.Z - bb.Min.Z)
        ElseIf MyViewSection.ViewDirection.Y = 1 Then 'DOWN
            minX = MyViewSection.Origin.X - (bb.Max.X - bb.Min.X) / 2
            maxX = MyViewSection.Origin.X + (bb.Max.X - bb.Min.X) / 2
            minY = MyViewSection.Origin.Y - (bb.Max.Z - bb.Min.Z)
            maxY = MyViewSection.Origin.Y
        ElseIf MyViewSection.ViewDirection.X = -1 Then 'RIGHT
            minX = MyViewSection.Origin.X
            maxX = MyViewSection.Origin.X + (bb.Max.Z - bb.Min.Z)
            minY = MyViewSection.Origin.Y - (bb.Max.X - bb.Min.X) / 2
            maxY = MyViewSection.Origin.Y + (bb.Max.X - bb.Min.X) / 2
        ElseIf MyViewSection.ViewDirection.X = 1 Then 'LEFT
            minX = MyViewSection.Origin.X - (bb.Max.Z - bb.Min.Z)
            maxX = MyViewSection.Origin.X
            minY = MyViewSection.Origin.Y - (bb.Max.X - bb.Min.X) / 2
            maxY = MyViewSection.Origin.Y + (bb.Max.X - bb.Min.X) / 2
        End If&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2016 09:02:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-sectionview-cropbox/m-p/6433203#M64292</guid>
      <dc:creator>pochao</dc:creator>
      <dc:date>2016-07-13T09:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to get SectionView cropbox?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-sectionview-cropbox/m-p/6433256#M64293</link>
      <description>&lt;P&gt;Dear Pochau,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your appreciation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just looking at your code I would guess that you want to compare two vectors, e.g. the bounding box Z vector and the view vector, project one onto the other, and determine the resulting X and Y components in some other direction, maybe perpendicular.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Find some ten-year old kid that goes to school and does geometry and vector algebra and ask her:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://en.wikipedia.org/wiki/Vector_space" target="_blank"&gt;https://en.wikipedia.org/wiki/Vector_space&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&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;Cheers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2016 09:49:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-get-sectionview-cropbox/m-p/6433256#M64293</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2016-07-13T09:49:00Z</dc:date>
    </item>
  </channel>
</rss>

