UserInterfaceManager.DoEvents

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to adapt a VBA routine to run in 64bit Inventor and accirding to Sanjay all DoEvents have to be replaced with "UserInterfaceManager.DoEvents" but this comes up with a variable not defined error. Am I missing an include?
All other posts refering to UserInterfaceManager.DoEvents are for .NET.
Below is the code where the problem is occouring.
Public Function Initialize() As Object
' Initialize flag.
bStillSelecting = True
' Create a new InteractionEvents object.
Set oInteraction = ThisApplication.CommandManager.CreateInteractionEvents
' Set the prompt.
oInteraction.StatusBarText = "Select a dimension."
' Connect to the associated select events.
Set oSelect = oInteraction.SelectEvents
' Enable single selection.
oSelect.SingleSelectEnabled = True
' Start the selection process.
oInteraction.Start
' Loop until a selection is made.
Do While bStillSelecting
UserInterfaceManager.DoEvents
Loop
' Get the selected item. If more than one thing was selected,
' just get the first item and ignore the rest.
Dim oSelectedEnts As ObjectsEnumerator
Set oSelectedEnts = oSelect.SelectedEntities
If oSelectedEnts.Count > 0 Then
Set Initialize = oSelectedEnts.Item(1)
Else
Set Initialize = Nothing
End If
' Stop the InteractionEvents object.
oInteraction.Stop
' Clean up.
Set oSelect = Nothing
Set oInteraction = Nothing
End Function