<?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: Setting view cube orientation with iLogic in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/setting-view-cube-orientation-with-ilogic/m-p/8188366#M87540</link>
    <description>&lt;P&gt;Here's a method for this I wrote a while back:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Public Shared Sub SetFrontViewToWorkplane(ByVal InventorApp As Inventor.Application, ByVal partDoc As PartDocument, ByVal selectedWorkPlane As WorkPlane)
    partDoc.SelectSet.Clear()
    partDoc.SelectSet.[Select](selectedWorkPlane)
    Dim selSet As SelectSet = partDoc.SelectSet
    Dim LookAt As ControlDefinition = InventorApp.CommandManager.ControlDefinitions("AppLookAtCmd")
    LookAt.Execute()
    selSet.Clear()
    Dim activeView As View = InventorApp.ActiveView
    activeView.SetCurrentAsFront()
End Sub&lt;/PRE&gt;&lt;P&gt;&lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@B4D44A73814D7FC0D950DEDFACB97081/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 09 Aug 2018 09:35:16 GMT</pubDate>
    <dc:creator>AlexFielder</dc:creator>
    <dc:date>2018-08-09T09:35:16Z</dc:date>
    <item>
      <title>Setting view cube orientation with iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/setting-view-cube-orientation-with-ilogic/m-p/8187506#M87533</link>
      <description>&lt;P&gt;I am looking to have an iLogic rule run in the background that will set the model front view to be normal to a work plane i have in the model. This is part of a parametric model and the view in the drawings will rotate when the parameters are edited. This moves my dimensions and alters the values to be unrepresented. I am still new to inventor iLogic and could really use some help. I have tried locking the view but that has not worked. Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 22:20:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/setting-view-cube-orientation-with-ilogic/m-p/8187506#M87533</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-08T22:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: Setting view cube orientation with iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/setting-view-cube-orientation-with-ilogic/m-p/8188366#M87540</link>
      <description>&lt;P&gt;Here's a method for this I wrote a while back:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Public Shared Sub SetFrontViewToWorkplane(ByVal InventorApp As Inventor.Application, ByVal partDoc As PartDocument, ByVal selectedWorkPlane As WorkPlane)
    partDoc.SelectSet.Clear()
    partDoc.SelectSet.[Select](selectedWorkPlane)
    Dim selSet As SelectSet = partDoc.SelectSet
    Dim LookAt As ControlDefinition = InventorApp.CommandManager.ControlDefinitions("AppLookAtCmd")
    LookAt.Execute()
    selSet.Clear()
    Dim activeView As View = InventorApp.ActiveView
    activeView.SetCurrentAsFront()
End Sub&lt;/PRE&gt;&lt;P&gt;&lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@B4D44A73814D7FC0D950DEDFACB97081/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 09:35:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/setting-view-cube-orientation-with-ilogic/m-p/8188366#M87540</guid>
      <dc:creator>AlexFielder</dc:creator>
      <dc:date>2018-08-09T09:35:16Z</dc:date>
    </item>
    <item>
      <title>Re: Setting view cube orientation with iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/setting-view-cube-orientation-with-ilogic/m-p/8188840#M87548</link>
      <description>&lt;P&gt;This is giving me an error&amp;nbsp;&lt;/P&gt;&lt;P&gt;"Rule Compile Errors in Rule0, in 005 - SUPPORT ARM DETAIL&lt;/P&gt;&lt;P&gt;Error on Line 1 : Statement cannot appear within a method body. End of method assumed.&lt;BR /&gt;Error on Line 13 : 'End Sub' must be preceded by a matching 'Sub'."&lt;/P&gt;&lt;P&gt;I am trying to do this in a part level, if that changes the way the code is written.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 13:33:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/setting-view-cube-orientation-with-ilogic/m-p/8188840#M87548</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-09T13:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: Setting view cube orientation with iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/setting-view-cube-orientation-with-ilogic/m-p/8188862#M87549</link>
      <description>&lt;P&gt;Being in a part shouldn't matter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You would need to call this from another method like this (this was written from memory so I can't say for certain it'll work 100%!):&lt;/P&gt;&lt;PRE&gt;Sub Main()
dim partDoc as partdocument = thisapplication.activedocument 'gets the activedocument in partdocument form
dim partDef as partcomponentdefinition = partdoc.componentdefinition 'gets the part file definition.
dim selectedworkplane as workplane = partDef.workplanes(1) 'gets the XY plane so swap this with whatever your object is
SetFrontViewToWorkplane(ThisApplication, partDoc, selectedworkplane)

End Sub

Public Shared Sub SetFrontViewToWorkplane(ByVal InventorApp As Inventor.Application, ByVal partDoc As PartDocument, ByVal selectedWorkPlane As WorkPlane)
    partDoc.SelectSet.Clear()
    partDoc.SelectSet.[Select](selectedWorkPlane)
    Dim selSet As SelectSet = partDoc.SelectSet
    Dim LookAt As ControlDefinition = InventorApp.CommandManager.ControlDefinitions("AppLookAtCmd")
    LookAt.Execute()
    selSet.Clear()
    Dim activeView As View = InventorApp.ActiveView
    activeView.SetCurrentAsFront()
End Sub&lt;/PRE&gt;&lt;P&gt;If you still have issues, please respond here with your complete rule and any error messages you receive.&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Alex.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 13:40:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/setting-view-cube-orientation-with-ilogic/m-p/8188862#M87549</guid>
      <dc:creator>AlexFielder</dc:creator>
      <dc:date>2018-08-09T13:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: Setting view cube orientation with iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/setting-view-cube-orientation-with-ilogic/m-p/8188894#M87551</link>
      <description>&lt;P&gt;That worked perfectly. Thank You.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 13:49:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/setting-view-cube-orientation-with-ilogic/m-p/8188894#M87551</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-09T13:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: Setting view cube orientation with iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/setting-view-cube-orientation-with-ilogic/m-p/11617756#M146502</link>
      <description>&lt;P&gt;Thank you very much. I'm new to ilogic and code. So how can i choose the desired workplane?&lt;/P&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2022 17:58:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/setting-view-cube-orientation-with-ilogic/m-p/11617756#M146502</guid>
      <dc:creator>ngoclebkdn</dc:creator>
      <dc:date>2022-12-13T17:58:59Z</dc:date>
    </item>
    <item>
      <title>Re: Setting view cube orientation with iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/setting-view-cube-orientation-with-ilogic/m-p/13225738#M175045</link>
      <description>&lt;P&gt;Hi, I'm trying to understand your code:&lt;/P&gt;&lt;PRE&gt;Dim LookAt As ControlDefinition = InventorApp.CommandManager.ControlDefinitions("AppLookAtCmd")&lt;/PRE&gt;&lt;P&gt;Where did U find this command "AppLookAtCmd" ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 22 Dec 2024 20:16:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/setting-view-cube-orientation-with-ilogic/m-p/13225738#M175045</guid>
      <dc:creator>l_cecelon</dc:creator>
      <dc:date>2024-12-22T20:16:32Z</dc:date>
    </item>
  </channel>
</rss>

