<?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: Anyone else having issues in 2011 64bit with InteractionEvents ??? in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/mouse-event-does-not-work-in-2011-2009-no-problems/m-p/2769648#M142628</link>
    <description>&lt;P&gt;Try replacing DoEvents with ThisApplication.UserInterfaceManager.DoEvents&lt;/P&gt;</description>
    <pubDate>Mon, 13 Sep 2010 21:24:51 GMT</pubDate>
    <dc:creator>sanjay.ramaswamy</dc:creator>
    <dc:date>2010-09-13T21:24:51Z</dc:date>
    <item>
      <title>Mouse Event does not work in 2011.  2009 no problems.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/mouse-event-does-not-work-in-2011-2009-no-problems/m-p/2763164#M142626</link>
      <description>&lt;P&gt;Code below works perfect in IV 2009 but doesn't work in IV 2011.&amp;nbsp; Both running on Windows XP 64bit.&amp;nbsp; All the program does is by running the TestSelection Sub the user clicks on Inventor screen and the code will place WorkPoints (Must have an assembly doc open).&amp;nbsp; User hits esc button to quit.&amp;nbsp; Very simple and works great in 2009 but with 2011 once the code hits the&amp;nbsp; oInteractEvents.Start the&amp;nbsp; oInteractEvents_OnTerminate() event gets triggered for no reason.&amp;nbsp; Anyone know why?&amp;nbsp; Planning on upgrading but always find something that prevents me from doing so.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks,&amp;nbsp; Chuck&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Public Sub TestSelection()
    Call SetToTopView
    Dim clsPick As New clsSelect
    
    clsPick.WaitForClick
End Sub
Sub SetToTopView()
    Dim oView As View
    Set oView = ThisApplication.ActiveView
    
    Dim oCamera As Camera
    Set oCamera = oView.Camera
    oCamera.ViewOrientationType = kTopViewOrientation
    oCamera.Apply
End Sub

'Class module code

Private WithEvents oInteractEvents As InteractionEvents

Private WithEvents oMouseEvents As MouseEvents

Private bStillSelecting As Boolean




Public Function WaitForClick() As Variant

    bStillSelecting = True
    Set oInteractEvents = ThisApplication.CommandManager.CreateInteractionEvents
    
    oInteractEvents.SelectionActive = True

    Set oMouseEvents = oInteractEvents.MouseEvents

    oMouseEvents.PointInferenceEnabled = True

    oMouseEvents.MouseMoveEnabled = False
    oInteractEvents.Start

    Do While bStillSelecting
        DoEvents
    Loop
  
    oInteractEvents.Stop
    Set oMouseEvents = Nothing
   
    Set oInteractEvents = Nothing
    
End Function


Private Sub oInteractEvents_OnTerminate()
    bStillSelecting = False
    MsgBox "Adding work points complete."
End Sub

Private Sub oMouseEvents_OnMouseClick(ByVal Button As MouseButtonEnum, ByVal ShiftKeys As ShiftStateEnum, ByVal ModelPosition As Point, ByVal ViewPosition As Point2d, ByVal View As View)
    Dim oPickPoint As Point
    Set oPickPoint = ModelPosition
    oPickPoint.Y = -0.5 * 2.54
    
    Dim oAssy As AssemblyDocument
    Set oAssy = ThisApplication.ActiveDocument
    
    Dim aPoint As WorkPoint
    Set aPoint = oAssy.ComponentDefinition.WorkPoints.AddFixed(oPickPoint)
    aPoint.Name = "FP " &amp;amp; aPoint.Name
End Sub

&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Sep 2010 23:55:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/mouse-event-does-not-work-in-2011-2009-no-problems/m-p/2763164#M142626</guid>
      <dc:creator>chuck_b</dc:creator>
      <dc:date>2010-09-03T23:55:27Z</dc:date>
    </item>
    <item>
      <title>Anyone else having issues in 2011 64bit with InteractionEvents ???</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/mouse-event-does-not-work-in-2011-2009-no-problems/m-p/2769348#M142627</link>
      <description>&lt;PRE&gt;Private WithEvents oInteractEvents As InteractionEvents&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 Sep 2010 17:14:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/mouse-event-does-not-work-in-2011-2009-no-problems/m-p/2769348#M142627</guid>
      <dc:creator>chuck_b</dc:creator>
      <dc:date>2010-09-13T17:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: Anyone else having issues in 2011 64bit with InteractionEvents ???</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/mouse-event-does-not-work-in-2011-2009-no-problems/m-p/2769648#M142628</link>
      <description>&lt;P&gt;Try replacing DoEvents with ThisApplication.UserInterfaceManager.DoEvents&lt;/P&gt;</description>
      <pubDate>Mon, 13 Sep 2010 21:24:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/mouse-event-does-not-work-in-2011-2009-no-problems/m-p/2769648#M142628</guid>
      <dc:creator>sanjay.ramaswamy</dc:creator>
      <dc:date>2010-09-13T21:24:51Z</dc:date>
    </item>
    <item>
      <title>Re: Anyone else having issues in 2011 64bit with InteractionEvents ???</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/mouse-event-does-not-work-in-2011-2009-no-problems/m-p/2769656#M142629</link>
      <description>&lt;P&gt;Thanks Sanjay,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried that and it didn't make a difference because I think it doesn't make it to that code in IV 2011.&amp;nbsp; At the time I was hoping that was all it was.&amp;nbsp; It just gets to this line below.&lt;/P&gt;&lt;PRE&gt;oInteractEvents.Start&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And fires this event right after&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Private Sub oInteractEvents_OnTerminate()&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would think IV 2009 would have not worked either because they are both native 64 bit.&amp;nbsp; IV 2009 works with just DoEvents but I have updated my code to be safe but still no luck with 2011&lt;/P&gt;</description>
      <pubDate>Mon, 13 Sep 2010 21:34:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/mouse-event-does-not-work-in-2011-2009-no-problems/m-p/2769656#M142629</guid>
      <dc:creator>chuck_b</dc:creator>
      <dc:date>2010-09-13T21:34:48Z</dc:date>
    </item>
    <item>
      <title>Re: Anyone else having issues in 2011 64bit with InteractionEvents ???</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/mouse-event-does-not-work-in-2011-2009-no-problems/m-p/2769666#M142630</link>
      <description>&lt;P&gt;Yes, I see the issue also. The line of code causing the problem seems to be this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;oMouseEvents.PointInferenceEnabled = True&lt;/P&gt;
&lt;P&gt;I commented out this line and the macro then seems to work. Doesn't look like you are using point inferences in your code, so perhaps you'll be ok removing this line. If not, post back and we'll see if we can find another workaround.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'll have this issue filed in our database. Thanks for reporting this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Sep 2010 21:58:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/mouse-event-does-not-work-in-2011-2009-no-problems/m-p/2769666#M142630</guid>
      <dc:creator>sanjay.ramaswamy</dc:creator>
      <dc:date>2010-09-13T21:58:49Z</dc:date>
    </item>
    <item>
      <title>Re: Anyone else having issues in 2011 64bit with InteractionEvents ???</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/mouse-event-does-not-work-in-2011-2009-no-problems/m-p/2769710#M142631</link>
      <description>&lt;P&gt;That works!&amp;nbsp; Thanks!!&amp;nbsp; Didn't need oMouseEvents.PointInferenceEnabled = True just came with a sample that I copied.&amp;nbsp; Thanks again...I would of never have found the cause on my own.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Chuck&lt;/P&gt;</description>
      <pubDate>Mon, 13 Sep 2010 23:34:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/mouse-event-does-not-work-in-2011-2009-no-problems/m-p/2769710#M142631</guid>
      <dc:creator>chuck_b</dc:creator>
      <dc:date>2010-09-13T23:34:30Z</dc:date>
    </item>
  </channel>
</rss>

