<?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 - Aligning base view with largest face landscape in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/drawing-aligning-base-view-with-largest-face-landscape/m-p/9040881#M71461</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Appreciate the time in helping me out, looks good and i will try this my project later today. It looks like i might be able to manipulate this to another feature i have been trying to work out which is&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Getting the current camera from a view and applying the same view to other views as we typically have different variations of parts / assemblies but need the view direction to be the same &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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nacho&lt;/P&gt;</description>
    <pubDate>Mon, 23 Sep 2019 15:23:24 GMT</pubDate>
    <dc:creator>NachoShaw</dc:creator>
    <dc:date>2019-09-23T15:23:24Z</dc:date>
    <item>
      <title>Drawing - Aligning base view with largest face landscape</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/drawing-aligning-base-view-with-largest-face-landscape/m-p/9034066#M71457</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;a while ago i wrote a method for positioning parts into my drawing that forces the base view to show the largest face and then also orients it so that its always landscape. It works well but its slow. The reason for that is the process it goes through which is-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;open part visible (only works visible)&lt;/P&gt;&lt;P&gt;loop through the part faces checking the area and storing the value&lt;/P&gt;&lt;P&gt;adding the face to a selection set only if the face is larger&lt;/P&gt;&lt;P&gt;once the larger face is selected, use the Look At command to bring that face to the camera&lt;/P&gt;&lt;P&gt;add the base view as Current View&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i believe it would be much faster if the opening visible process was removed but then how could i reorient the view? is it possible to do this with a matrix of some sort to get the largest face and orient it as the base view?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 04:58:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/drawing-aligning-base-view-with-largest-face-landscape/m-p/9034066#M71457</guid>
      <dc:creator>NachoShaw</dc:creator>
      <dc:date>2019-09-19T04:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing - Aligning base view with largest face landscape</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/drawing-aligning-base-view-with-largest-face-landscape/m-p/9034994#M71458</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1262283"&gt;@NachoShaw&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;i believe it would be much faster if the opening visible process was removed but then how could i reorient the view? is it possible to do this with a matrix of some sort to get the largest face and orient it as the base view?&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Does &lt;A href="http://help.autodesk.com/view/INVNTOR/2020/ENU/?guid=GUID-08B008E5-774A-4E04-ABBA-AB7D09901831" target="_blank" rel="noopener"&gt;DrawingView.Camera Property&lt;/A&gt; help you?&lt;/P&gt;&lt;P&gt;I have never used Camera APIs, but I feel it is possible.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=====&lt;/P&gt;&lt;P&gt;Freeradical&lt;/P&gt;&lt;P&gt;&amp;nbsp;Hideo Yamada&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 13:33:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/drawing-aligning-base-view-with-largest-face-landscape/m-p/9034994#M71458</guid>
      <dc:creator>HideoYamada</dc:creator>
      <dc:date>2019-09-19T13:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing - Aligning base view with largest face landscape</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/drawing-aligning-base-view-with-largest-face-landscape/m-p/9035085#M71459</link>
      <description>&lt;P&gt;I did quick hack, but could not make change to the DrawingView.Camera.&lt;/P&gt;&lt;P&gt;All of the changes to the eye point that my code did were ignored.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 14:04:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/drawing-aligning-base-view-with-largest-face-landscape/m-p/9035085#M71459</guid>
      <dc:creator>HideoYamada</dc:creator>
      <dc:date>2019-09-19T14:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing - Aligning base view with largest face landscape</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/drawing-aligning-base-view-with-largest-face-landscape/m-p/9040304#M71460</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is not a complete solution for you, but I found the way to change a DrawingView orientation and report now.&lt;/P&gt;&lt;P&gt;(And I hope this code helping you.)&lt;/P&gt;&lt;PRE&gt;Option Explicit

Sub FlipCameraToOppositeView()
    Dim oDrawingDoc As DrawingDocument
    Set oDrawingDoc = ThisApplication.ActiveDocument
    
    Dim oSourceView As DrawingView
    Set oSourceView = oDrawingDoc.ActiveSheet.DrawingViews(1)
    
    Dim oCamera As Camera
    Set oCamera = oSourceView.Camera
    Dim oUpVector As UnitVector
    Set oUpVector = oCamera.UpVector
    
    oCamera.Eye = GetOppositeEyePoint(oCamera)
    oCamera.UpVector = oUpVector
    oCamera.ApplyWithoutTransition
End Sub

Function GetOppositeEyePoint(oCamera As Camera) As Point
    Dim X As Double
    Dim Y As Double
    Dim Z As Double

    X = oCamera.Target.X * 2 - oCamera.Eye.X
    Y = oCamera.Target.Y * 2 - oCamera.Eye.Y
    Z = oCamera.Target.Z * 2 - oCamera.Eye.Z
    
    Set GetOppositeEyePoint = ThisApplication.TransientGeometry.CreatePoint(X, Y, Z)
End Function&lt;/PRE&gt;&lt;P&gt;This code moves the eye point to the opposite side of the target point.&lt;/P&gt;&lt;P&gt;Overwriting the X, Y, Z of Camera.Eye directly will be ignored as I wrote in my last post, but overwriting Eye of Camera is valid.&lt;/P&gt;&lt;P&gt;invalid : oCamera.Eye.X = value&lt;/P&gt;&lt;P&gt;valid : oCamera.Eye = oPoint&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=====&lt;/P&gt;&lt;P&gt;Freeradical&lt;/P&gt;&lt;P&gt;&amp;nbsp;Hideo Yamada&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 11:10:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/drawing-aligning-base-view-with-largest-face-landscape/m-p/9040304#M71460</guid>
      <dc:creator>HideoYamada</dc:creator>
      <dc:date>2019-09-23T11:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing - Aligning base view with largest face landscape</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/drawing-aligning-base-view-with-largest-face-landscape/m-p/9040881#M71461</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Appreciate the time in helping me out, looks good and i will try this my project later today. It looks like i might be able to manipulate this to another feature i have been trying to work out which is&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Getting the current camera from a view and applying the same view to other views as we typically have different variations of parts / assemblies but need the view direction to be the same &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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nacho&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 15:23:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/drawing-aligning-base-view-with-largest-face-landscape/m-p/9040881#M71461</guid>
      <dc:creator>NachoShaw</dc:creator>
      <dc:date>2019-09-23T15:23:24Z</dc:date>
    </item>
  </channel>
</rss>

