<?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: Place prompted text at cursor like with commandmanager.pick in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/place-prompted-text-at-cursor-like-with-commandmanager-pick/m-p/12416696#M16052</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5011186"&gt;@JelteDeJong&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the suggestion.&lt;/P&gt;
&lt;P&gt;I have seen that already via the "InteractionEvents", but that is not what I am searching for.&lt;/P&gt;
&lt;P&gt;The&amp;nbsp;"InteractionEvents" do not work for my needs since the selection is not part of the API, therefor not selectable.&lt;/P&gt;
&lt;P&gt;Do you know another way to do is without that any action I can put text on the cursor.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 03 Dec 2023 21:32:45 GMT</pubDate>
    <dc:creator>bradeneuropeArthur</dc:creator>
    <dc:date>2023-12-03T21:32:45Z</dc:date>
    <item>
      <title>Place prompted text at cursor like with commandmanager.pick</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/place-prompted-text-at-cursor-like-with-commandmanager-pick/m-p/12415460#M16050</link>
      <description>&lt;P&gt;How to place prompted text at cursor like CommandManager.Pick does, via vba/vba.net/ilogic?&lt;/P&gt;</description>
      <pubDate>Sat, 02 Dec 2023 20:05:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/place-prompted-text-at-cursor-like-with-commandmanager-pick/m-p/12415460#M16050</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2023-12-02T20:05:40Z</dc:date>
    </item>
    <item>
      <title>Re: Place prompted text at cursor like with commandmanager.pick</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/place-prompted-text-at-cursor-like-with-commandmanager-pick/m-p/12416647#M16051</link>
      <description>&lt;P&gt;You can implement your version of the method: "commandmanager.pick". Then you have more options too. something like this:&lt;/P&gt;
&lt;LI-CODE lang="visual-basic"&gt;Public Class ThisRule
    Public Sub main()

        Dim selector As New Selector(ThisApplication)
        selector.MousePointerText = "Test test"
        selector.Filter = ObjectTypeEnum.kLinearGeneralDimensionObject
        selector.CursorType = CursorTypeEnum.kCursorBuiltInDynpan
        selector.Pick()

        Dim firstSelectedObject = selector.SelectedObjects.Item(1)
        Dim type = CType(firstSelectedObject.Type, ObjectTypeEnum)
        MsgBox(type.ToString())

    End Sub
End Class

Public Class Selector
    Private WithEvents _interactEvents As InteractionEvents
    Private WithEvents _selectEvents As SelectEvents
    Private _stillSelecting As Boolean
    Private _inventor As Inventor.Application

    Public Sub New(ThisApplication As Inventor.Application)
        _inventor = ThisApplication
    End Sub

    Public Sub Pick()
        _stillSelecting = True

        _interactEvents = _inventor.CommandManager.CreateInteractionEvents
        _interactEvents.InteractionDisabled = False
        _interactEvents.StatusBarText = MousePointerText
        '                     ^-- This will also set the mousepointer text
        _interactEvents.SetCursor(CursorType)

        _selectEvents = _interactEvents.SelectEvents
        _selectEvents.WindowSelectEnabled = False

        _interactEvents.Start()
        Do While _stillSelecting
            _inventor.UserInterfaceManager.DoEvents()
        Loop
        _interactEvents.Stop()

        _inventor.CommandManager.StopActiveCommand()
    End Sub

    Public Property SelectedObjects As ObjectsEnumerator = Nothing
    Public Property MousePointerText As String = "Select ..."
    Public Property CursorType As CursorTypeEnum = CursorTypeEnum.kCursorTypeDefault
    Public Property Filter As ObjectTypeEnum = Nothing

    Private Sub selectEvents_OnPreSelect(
            ByRef PreSelectEntity As Object,
            ByRef DoHighlight As Boolean,
            ByRef MorePreSelectEntities As ObjectCollection,
            SelectionDevice As SelectionDeviceEnum,
            ModelPosition As Inventor.Point,
            ViewPosition As Point2d,
            View As Inventor.View) Handles _selectEvents.OnPreSelect

        DoHighlight = False

        If (Filter = Nothing) Then
            DoHighlight = True
        End If
        Try
            If (PreSelectEntity.Type = Filter) Then
                DoHighlight = True
            End If
        Catch ex As Exception
        End Try
    End Sub

    Private Sub selectEvents_OnSelect(
            ByVal JustSelectedEntities As ObjectsEnumerator,
            ByVal SelectionDevice As SelectionDeviceEnum,
            ByVal ModelPosition As Inventor.Point,
            ByVal ViewPosition As Point2d,
            ByVal View As Inventor.View) Handles _selectEvents.OnSelect

        SelectedObjects = JustSelectedEntities
        _stillSelecting = False
    End Sub

    Private Sub interactEvents_OnTerminate() Handles _interactEvents.OnTerminate
        _stillSelecting = False
    End Sub
End Class&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Dec 2023 20:42:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/place-prompted-text-at-cursor-like-with-commandmanager-pick/m-p/12416647#M16051</guid>
      <dc:creator>JelteDeJong</dc:creator>
      <dc:date>2023-12-03T20:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: Place prompted text at cursor like with commandmanager.pick</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/place-prompted-text-at-cursor-like-with-commandmanager-pick/m-p/12416696#M16052</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5011186"&gt;@JelteDeJong&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the suggestion.&lt;/P&gt;
&lt;P&gt;I have seen that already via the "InteractionEvents", but that is not what I am searching for.&lt;/P&gt;
&lt;P&gt;The&amp;nbsp;"InteractionEvents" do not work for my needs since the selection is not part of the API, therefor not selectable.&lt;/P&gt;
&lt;P&gt;Do you know another way to do is without that any action I can put text on the cursor.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Dec 2023 21:32:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/place-prompted-text-at-cursor-like-with-commandmanager-pick/m-p/12416696#M16052</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2023-12-03T21:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: Place prompted text at cursor like with commandmanager.pick</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/place-prompted-text-at-cursor-like-with-commandmanager-pick/m-p/12417874#M16053</link>
      <description>&lt;P&gt;&amp;nbsp;The InteractionEvents are very powerful and I expect that it can select anything in the Inventor environment. Can you tell me a bit more about the things that you are trying to select?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the past, I did have a case where I needed to make a selection that distinguished between the dimension line and extension lines (of a dimension). That is not possible with the standard selection API but I managed to do it with the InteractionEvents. I wrote a blog post about it "&lt;A href="http://www.hjalte.nl/63-selecting-dimension-lines" target="_blank" rel="noopener"&gt;Selecting dimensions&lt;/A&gt;".&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 11:17:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/place-prompted-text-at-cursor-like-with-commandmanager-pick/m-p/12417874#M16053</guid>
      <dc:creator>JelteDeJong</dc:creator>
      <dc:date>2023-12-04T11:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: Place prompted text at cursor like with commandmanager.pick</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/place-prompted-text-at-cursor-like-with-commandmanager-pick/m-p/12419088#M16054</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5011186"&gt;@JelteDeJong&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I try to select the weldsymbol in Inventor 2024. These are now part of the API. But the interaction events are not working for these, because they are not part of the filter (typeenum).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 19:52:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/place-prompted-text-at-cursor-like-with-commandmanager-pick/m-p/12419088#M16054</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2023-12-04T19:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: Place prompted text at cursor like with commandmanager.pick</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/place-prompted-text-at-cursor-like-with-commandmanager-pick/m-p/12419456#M16055</link>
      <description>&lt;P&gt;I found a way to (sort of) select the welding symbols. It's an ugly hack but it works. The preselect event recognises the "DrawingWeldSymbol". I expect that it's a bug that it isn't recognised by the select event. You can work around this by saving the preselected object in a property and wait for the select interaction to end. This can be done like this: User clicks on the weld symbol and presses "esc" key. (What do you think about it?)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JelteDeJong_0-1701731635811.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1300735iCEFF661513D33321/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JelteDeJong_0-1701731635811.png" alt="JelteDeJong_0-1701731635811.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="visual-basic"&gt;Public Class ThisRule
    Public Sub main()

        Dim selector As New Selector(ThisApplication)
        selector.Pick()

        Dim weldSymbol As DrawingWeldingSymbol = selector.SelectedObject

        MsgBox(weldSymbol.Definitions.Item(1).TailNote)
    End Sub
End Class

Public Class Selector
    Private WithEvents _interactEvents As InteractionEvents
    Private WithEvents _selectEvents As SelectEvents
    Private _stillSelecting As Boolean
    Private _inventor As Inventor.Application

    Public Sub New(ThisApplication As Inventor.Application)
        _inventor = ThisApplication
    End Sub

    Public Sub Pick()
        _stillSelecting = True

        _interactEvents = _inventor.CommandManager.CreateInteractionEvents
        _interactEvents.InteractionDisabled = False
        _interactEvents.StatusBarText = MousePointerText
        '                     ^-- This will also set the mousepointer text
        _interactEvents.SetCursor(CursorType)

        _selectEvents = _interactEvents.SelectEvents
        _selectEvents.WindowSelectEnabled = False

        _interactEvents.Start()
        Do While _stillSelecting
            _inventor.UserInterfaceManager.DoEvents()
        Loop
        _interactEvents.Stop()

        _inventor.CommandManager.StopActiveCommand()
    End Sub

    Public Property SelectedObject As DrawingWeldingSymbol = Nothing
    Public Property MousePointerText As String = "Select ..."
    Public Property CursorType As CursorTypeEnum = CursorTypeEnum.kCursorTypeDefault
    Public Property Filter As ObjectTypeEnum = Nothing

    Private Sub selectEvents_OnStopPreSelect(ModelPosition As Point, ViewPosition As Point2d, View As View) Handles _selectEvents.OnStopPreSelect
        _interactEvents.StatusBarText = "..."
    End Sub

    Private Sub selectEvents_OnPreSelect(
            ByRef PreSelectEntity As Object,
            ByRef DoHighlight As Boolean,
            ByRef MorePreSelectEntities As ObjectCollection,
            SelectionDevice As SelectionDeviceEnum,
            ModelPosition As Inventor.Point,
            ViewPosition As Point2d,
            View As Inventor.View) Handles _selectEvents.OnPreSelect

        DoHighlight = False

        _interactEvents.StatusBarText = Microsoft.VisualBasic.Information.TypeName(PreSelectEntity)

        If (TypeOf PreSelectEntity Is DrawingWeldingSymbol) Then
            _interactEvents.StatusBarText = "DrawingWeldingSymbol has been found!!! (press escape to continue.)"
            SelectedObject = PreSelectEntity
            DoHighlight = True
        End If
    End Sub

    Private Sub selectEvents_OnSelect(
            ByVal JustSelectedEntities As ObjectsEnumerator,
            ByVal SelectionDevice As SelectionDeviceEnum,
            ByVal ModelPosition As Inventor.Point,
            ByVal ViewPosition As Point2d,
            ByVal View As Inventor.View) Handles _selectEvents.OnSelect

        SelectedObject = JustSelectedEntities
        _stillSelecting = False
    End Sub

    Private Sub interactEvents_OnTerminate() Handles _interactEvents.OnTerminate
        _stillSelecting = False
    End Sub
End Class&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 23:14:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/place-prompted-text-at-cursor-like-with-commandmanager-pick/m-p/12419456#M16055</guid>
      <dc:creator>JelteDeJong</dc:creator>
      <dc:date>2023-12-04T23:14:53Z</dc:date>
    </item>
    <item>
      <title>Re: Place prompted text at cursor like with commandmanager.pick</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/place-prompted-text-at-cursor-like-with-commandmanager-pick/m-p/12424380#M16056</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5011186"&gt;@JelteDeJong&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;But that will not work for me at the moment.&lt;/P&gt;
&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/486618"&gt;@johnsonshiue&lt;/a&gt;&amp;nbsp;could you or your team have a look at the missing object in the API for WeldSymbols, so that we can also use the CommandManagerPick event for WeldSymbols.&lt;/P&gt;
&lt;P&gt;Thans in advance,&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2023 21:13:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/place-prompted-text-at-cursor-like-with-commandmanager-pick/m-p/12424380#M16056</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2023-12-06T21:13:18Z</dc:date>
    </item>
  </channel>
</rss>

