<?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: Rotate Drawing View with Included Sketch Crashes in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/rotate-drawing-view-with-included-sketch-crashes/m-p/11106411#M38308</link>
    <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/684354"&gt;@johnster100&lt;/a&gt;.&amp;nbsp; Simple, yet interesting case.&amp;nbsp; After trying both the DrawingView.RotateByAngle() method and simply trying to set an angle to the DrawingView.Rotation property, and both failed, I decided to try it manually, which finally worked, interestingly enough.&amp;nbsp; So, I stated looking into a way to automate that manual process by code.&amp;nbsp; The simplest way I know how is to execute the same command that the manual tool uses, then use the SendKeys.SendWait() method to simulate navigating the dialog by keyboard interaction.&amp;nbsp; Here is the code routine that worked to rotate the view by 90 degrees for me.&amp;nbsp; This is of course a last resort solution, and is most likely not the most stable way to do it.&amp;nbsp; And I'm not sure if the needed order of operations, as far as keyboard interaction, will work for everyone either.&amp;nbsp; If not, it may take a little trial an error testing, by doing it manually using the keyboard, recording what keys you had to use, then putting that into the code.&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;oView = ActiveSheet.View("VIEW2").View
Dim oDDoc As DrawingDocument = oView.Parent.Parent
oSS = oDDoc.SelectSet
oSS.Clear
oSS.Select(oView)
oCD = ThisApplication.CommandManager.ControlDefinitions.Item("DrawingViewRotateCtxCmd")
oSS.Select(oView)
oCD.Execute2(False)
AppActivate(ThisApplication.Caption)
System.Windows.Forms.SendKeys.SendWait("{DOWN}^A90{TAB}{UP}{ENTER}")&lt;/LI-CODE&gt;
&lt;P&gt;If this solved your problem, or answered your question, please click &lt;SPAN&gt;&lt;STRONG&gt;ACCEPT SOLUTION&lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;BR /&gt;Or, if this helped you, please click (LIKE or KUDOS) &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;.&lt;/P&gt;
&lt;P&gt;If you want and have time, I would appreciate your Vote(s) for &lt;A href="https://forums.autodesk.com/t5/forums/recentpostspage/post-type/message/interaction-style/idea/user-id/7812054/" target="_blank"&gt;My IDEAS &lt;/A&gt; :bulb: or you can Explore &lt;A href="https://knowledge.autodesk.com/profile/LTSUSR7HXMSAE/articles" target="_blank"&gt;My CONTRIBUTIONS &lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Apr 2022 15:16:53 GMT</pubDate>
    <dc:creator>WCrihfield</dc:creator>
    <dc:date>2022-04-14T15:16:53Z</dc:date>
    <item>
      <title>Rotate Drawing View with Included Sketch Crashes</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/rotate-drawing-view-with-included-sketch-crashes/m-p/11105886#M38307</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to rotate a drawing view using iLogic. This works fine when the view has no sketches included, but crashes when include a sketch. I am using Inventor 2019.4.9.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached a simple drawing showing the crash. (rule 1 rotates the view without the sketch, rule 2 crashes on the drawing view with the sketch).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any workaround to this issue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2022 12:05:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/rotate-drawing-view-with-included-sketch-crashes/m-p/11105886#M38307</guid>
      <dc:creator>johnster100</dc:creator>
      <dc:date>2022-04-14T12:05:32Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate Drawing View with Included Sketch Crashes</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/rotate-drawing-view-with-included-sketch-crashes/m-p/11106411#M38308</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/684354"&gt;@johnster100&lt;/a&gt;.&amp;nbsp; Simple, yet interesting case.&amp;nbsp; After trying both the DrawingView.RotateByAngle() method and simply trying to set an angle to the DrawingView.Rotation property, and both failed, I decided to try it manually, which finally worked, interestingly enough.&amp;nbsp; So, I stated looking into a way to automate that manual process by code.&amp;nbsp; The simplest way I know how is to execute the same command that the manual tool uses, then use the SendKeys.SendWait() method to simulate navigating the dialog by keyboard interaction.&amp;nbsp; Here is the code routine that worked to rotate the view by 90 degrees for me.&amp;nbsp; This is of course a last resort solution, and is most likely not the most stable way to do it.&amp;nbsp; And I'm not sure if the needed order of operations, as far as keyboard interaction, will work for everyone either.&amp;nbsp; If not, it may take a little trial an error testing, by doing it manually using the keyboard, recording what keys you had to use, then putting that into the code.&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;oView = ActiveSheet.View("VIEW2").View
Dim oDDoc As DrawingDocument = oView.Parent.Parent
oSS = oDDoc.SelectSet
oSS.Clear
oSS.Select(oView)
oCD = ThisApplication.CommandManager.ControlDefinitions.Item("DrawingViewRotateCtxCmd")
oSS.Select(oView)
oCD.Execute2(False)
AppActivate(ThisApplication.Caption)
System.Windows.Forms.SendKeys.SendWait("{DOWN}^A90{TAB}{UP}{ENTER}")&lt;/LI-CODE&gt;
&lt;P&gt;If this solved your problem, or answered your question, please click &lt;SPAN&gt;&lt;STRONG&gt;ACCEPT SOLUTION&lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;BR /&gt;Or, if this helped you, please click (LIKE or KUDOS) &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;.&lt;/P&gt;
&lt;P&gt;If you want and have time, I would appreciate your Vote(s) for &lt;A href="https://forums.autodesk.com/t5/forums/recentpostspage/post-type/message/interaction-style/idea/user-id/7812054/" target="_blank"&gt;My IDEAS &lt;/A&gt; :bulb: or you can Explore &lt;A href="https://knowledge.autodesk.com/profile/LTSUSR7HXMSAE/articles" target="_blank"&gt;My CONTRIBUTIONS &lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2022 15:16:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/rotate-drawing-view-with-included-sketch-crashes/m-p/11106411#M38308</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2022-04-14T15:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate Drawing View with Included Sketch Crashes</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/rotate-drawing-view-with-included-sketch-crashes/m-p/11115980#M38309</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;thanks for the reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I ended up making my sketches into surfaces and including them, which worked as they were simple sketches.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2022 07:09:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/rotate-drawing-view-with-included-sketch-crashes/m-p/11115980#M38309</guid>
      <dc:creator>johnster100</dc:creator>
      <dc:date>2022-04-20T07:09:34Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate Drawing View with Included Sketch Crashes</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/rotate-drawing-view-with-included-sketch-crashes/m-p/11928262#M38310</link>
      <description>&lt;PRE&gt;&lt;SPAN class=""&gt;hello it is possible to modify the rule so that the view rotates and sets on the Home view of the Cube
Thank you&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 28 Apr 2023 12:50:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/rotate-drawing-view-with-included-sketch-crashes/m-p/11928262#M38310</guid>
      <dc:creator>ch_giacomo</dc:creator>
      <dc:date>2023-04-28T12:50:22Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate Drawing View with Included Sketch Crashes</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/rotate-drawing-view-with-included-sketch-crashes/m-p/11928480#M38311</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10260301"&gt;@ch_giacomo&lt;/a&gt;.&amp;nbsp; Here is a similar simple iLogic rule you can use to change the view's orientation to a specific one.&amp;nbsp; There are many variations of that &lt;A href="https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=ViewOrientationTypeEnum" target="_blank" rel="noopener"&gt;ViewOrientationTypeEnum&lt;/A&gt; to choose from.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Dim oView As DrawingView = ActiveSheet.View("VIEW1").View
oView.Camera.ViewOrientationType = ViewOrientationTypeEnum.kIsoTopRightViewOrientation
oView.Camera.Apply&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But keep in mind that you may only be able to do this to a 'Base' type view, not a projected view, because projected views have their orientation dictated by the view they are being projected from.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this solved your problem, or answered your question, please click &lt;SPAN&gt;&lt;STRONG&gt; ACCEPT SOLUTION &lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;BR /&gt;Or, if this helped you, please click (LIKE or KUDOS) &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 13:55:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/rotate-drawing-view-with-included-sketch-crashes/m-p/11928480#M38311</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2023-04-28T13:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate Drawing View with Included Sketch Crashes</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/rotate-drawing-view-with-included-sketch-crashes/m-p/11928710#M38312</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Thank you so much.. perfect what I needed..&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 15:15:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/rotate-drawing-view-with-included-sketch-crashes/m-p/11928710#M38312</guid>
      <dc:creator>ch_giacomo</dc:creator>
      <dc:date>2023-04-28T15:15:36Z</dc:date>
    </item>
  </channel>
</rss>

