<?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: Selecting a Point2D with your mouse on a drawing sheet in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/11141656#M133038</link>
    <description>&lt;P&gt;-&lt;/P&gt;</description>
    <pubDate>Mon, 02 May 2022 09:42:52 GMT</pubDate>
    <dc:creator>PizzolatoDavide</dc:creator>
    <dc:date>2022-05-02T09:42:52Z</dc:date>
    <item>
      <title>Selecting a Point2D with your mouse on a drawing sheet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/3739407#M133015</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I define a Point2D with my mouse by clicking on an random place in a drawingsheet?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have made the code below that creates a DetailDrawingView automatic. I am now searching a method to select the oPoint &amp;amp; oCenterPoint with my mouse. Both are defined as Poin2D.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I find a lot a method's where you can manipulate the Point2D using maths but I never found a method where you can get the Point2D by just clicking somewhere on the sheet (drawingview).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Sub AutoDetailedView()
' Set a reference to the drawing document.
    ' This assumes a drawing document is active.
    Dim oDrawDoc As DrawingDocument
    Set oDrawDoc = ThisApplication.ActiveDocument

    'Set a reference to the active sheet.
    Dim oSheet As Sheet
    Set oSheet = oDrawDoc.ActiveSheet
      
    ' Manually select a drawing view
    Dim oDrawingView As DrawingView
    Set oDrawingView = ThisApplication.CommandManager.Pick(kDrawingViewFilter, "Select a drawing view.")
    
    ' Set a reference to the center of the base view.
    Dim oPoint As Point2d
    Set oPoint = oDrawingView.Center

    ' Translate point by a distance = 2 * width of the view
    ' This will be the placement point of the detail view.
    oPoint.x = oPoint.x + 2 * oDrawingView.Width
    
    ' Set corner one of rectangular fence as
    ' the left-bottom corner of the base view.
    Dim oCenterPoint As Point2d
    Set oCenterPoint = oDrawingView.Center
    
    oCenterPoint.x = oCenterPoint.x - oDrawingView.Width / 10
    oCenterPoint.Y = oCenterPoint.Y - oDrawingView.Height / 10
          
    ' Get any linear curve from the base view
    Dim oCurve As DrawingCurve
    For Each oCurve In oDrawingView.DrawingCurves
    If oCurve.CurveType = kLineSegmentCurve Then Exit For
    Next
    
    ' Create an intent object
    Dim oAttachPoint As Point2d
    Set oAttachPoint = oDrawingView.Center
    
    ' Create the detail view
    Dim oDetailView As DetailDrawingView
    Set oDetailView = oSheet.DrawingViews.AddDetailView(oDrawingView, oPoint, kShadedDrawingViewStyle, True, oCenterPoint, 0.3, , 0.25, False, " ")
  'Set breakline to smooth
  oDetailView.IsBreakLineSmooth = True
  'Show full detail boundary
 oDetailView.DisplayFullBoundary = True
  'Show connection line
  oDetailView.DisplayConnectionLine = True
   
End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2012 20:19:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/3739407#M133015</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-12-18T20:19:09Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting a Point2D with your mouse on a drawing sheet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/3739739#M133016</link>
      <description>&lt;P&gt;Here is some could I think that could do the trick: &lt;A title="Link" target="_blank" href="https://forums.autodesk.com/t5/Autodesk-Inventor-Customization/Mouse-click-event-Inventor-2012-VBA-is-erratic-code-worked-fine/m-p/3301451/highlight/false#M37341"&gt;Link&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I can't get it to work. My knowledge of function is to low( actually inexisting :()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can give some tips on how to implent this?&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2012 12:16:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/3739739#M133016</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-12-19T12:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting a Point2D with your mouse on a drawing sheet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/3740317#M133017</link>
      <description>&lt;P&gt;You need to use the InteractionEvents object to do this.&amp;nbsp; This is a very powerful object, but as a result of this power it can sometimes be a bit intimidating to use.&amp;nbsp; Using it from VBA is also a bit more of a challenge because it's very event oriented and events are a bit more difficult in VBA because you can only handle events from form or class modules.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the code below I've created a small VBA class that does the work using the MouseEvents object, which is part of the functionality of the InteractionEvents object.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, here's some code that uses the class.&amp;nbsp; You'll see that it creates an instance of the clsGetPoint object and then calls its GetDrawingPoint method.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Public Sub TestGetDrawingPoint()
    Dim getPoint As New clsGetPoint
    Dim pnt As Point2d
    
    Do
        Set pnt = getPoint.GetDrawingPoint("Click the desired location", kLeftMouseButton)
        If Not pnt Is Nothing Then
            MsgBox "Click is at " &amp;amp; Format(pnt.x, "0.0000") &amp;amp; ", " &amp;amp; Format(pnt.y, "0.0000")
        End If
    Loop While Not pnt Is Nothing
End Sub
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;In VBA you'll need to create a new class module and name it "clsGetPoint".&amp;nbsp; Insert the code below&amp;nbsp;into the class.&lt;/P&gt;
&lt;PRE&gt;Private WithEvents m_interaction As InteractionEvents
Private WithEvents m_mouse As MouseEvents
Private m_position As Point2d
Private m_button As MouseButtonEnum
Private m_continue As Boolean


Public Function GetDrawingPoint(Prompt As String, button As MouseButtonEnum) As Point2d
    Set m_position = Nothing
    m_button = button
    
    Set m_interaction = ThisApplication.CommandManager.CreateInteractionEvents
    Set m_mouse = m_interaction.MouseEvents
    
    m_interaction.StatusBarText = Prompt
    
    m_interaction.Start
    
    m_continue = True
    Do
        DoEvents
    Loop While m_continue
    
    m_interaction.Stop
    
    Set GetDrawingPoint = m_position
End Function


Private Sub m_mouse_OnMouseClick(ByVal button As MouseButtonEnum, ByVal ShiftKeys As ShiftStateEnum, ByVal ModelPosition As Point, ByVal ViewPosition As Point2d, ByVal View As View)
    If button = m_button Then
        Set m_position = ThisApplication.TransientGeometry.CreatePoint2d(ModelPosition.x, ModelPosition.y)
    End If
    
    m_continue = False
End Sub
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2012 22:32:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/3740317#M133017</guid>
      <dc:creator>ekinsb</dc:creator>
      <dc:date>2012-12-19T22:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting a Point2D with your mouse on a drawing sheet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/3740503#M133018</link>
      <description>&lt;P&gt;Nice &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this did the trick.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My final code: (It call's your Class Module clsGetPoint)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Sub AutoDetailedView()
' Set a reference to the drawing document.
    ' This assumes a drawing document is active.
    Dim oDrawDoc As DrawingDocument
    Set oDrawDoc = ThisApplication.ActiveDocument

    'Set a reference to the active sheet.
    Dim oSheet As Sheet
    Set oSheet = oDrawDoc.ActiveSheet
      
    ' Select a drawing view
    Dim oDrawingView As DrawingView
    Set oDrawingView = ThisApplication.CommandManager.Pick(kDrawingViewFilter, "Select a drawing view.")
    
    ' Select the center of the circular fence
    Dim getPoint As New clsGetPoint
    Dim oCenterPoint As Point2d
    Set oCenterPoint = getPoint.GetDrawingPoint("Please select the area to be detailed", kLeftMouseButton)
    
    ' Select the place where the detailed view need to be placed
    Dim oPoint As Point2d
    Set oPoint = getPoint.GetDrawingPoint("Please select the location of the detailed view", kLeftMouseButton)
    
    ' Get any linear curve from the base view
    Dim oCurve As DrawingCurve
    For Each oCurve In oDrawingView.DrawingCurves
    If oCurve.CurveType = kLineSegmentCurve Then Exit For
    Next
    
    ' Create an intent object
    Dim oAttachPoint As Point2d
    Set oAttachPoint = oDrawingView.Center
    
    ' Create the detail view
    Dim oDetailView As DetailDrawingView
    Set oDetailView = oSheet.DrawingViews.AddDetailView(oDrawingView, oPoint, kShadedDrawingViewStyle, True, oCenterPoint, 0.5, , 0.25, False, " ")
  'Set breakline to smooth
  oDetailView.IsBreakLineSmooth = True
  'Show full detail boundary
 oDetailView.DisplayFullBoundary = True
  'Show connection line
  oDetailView.DisplayConnectionLine = True
   'set detailview to "Parts"
        ' this assumes that there is an detailview called "Parts", if not, delete this line
   On Error Resume Next
    Call oDetailView.SetDesignViewRepresentation("Parts", False)

End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now we have 30 seconds less clicking to do every time we make a detailed drawing view:-). If we do this 10x a day with our 4 users this means &lt;STRONG&gt;a saving of &lt;U&gt;8.33 workdays&lt;/U&gt; a year &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;More time savings like this could be accomplished by: &lt;A title="Vote on me :-)" target="_blank" href="https://forums.autodesk.com/t5/Inventor-IdeaStation/Rember-input-of-command-s-Less-Clicks/idi-p/3738139#.UNLg0Xe8rHw"&gt;Inventor idea station&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for the help!&lt;/P&gt;</description>
      <pubDate>Thu, 20 Dec 2012 09:58:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/3740503#M133018</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-12-20T09:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting a Point2D with your mouse on a drawing sheet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/4305341#M133019</link>
      <description>&lt;P&gt;Brian.&lt;/P&gt;&lt;P&gt;How do i use this mouse pick point in a VB.net Drawing Add-in?&lt;/P&gt;&lt;P&gt;I created a Class file in my project and changed the ' Thisapplication' sections. Visual studio Express say's i have no errors. In my form i created a button containing the TestGetDrawingPoint code, and added the mouseEnum to the kLeftMouseButton. But when i trying my add-in, it crashes.&lt;/P&gt;&lt;P&gt;Do you have a good vb.net example, i searched a long time but i can't find a working example.&lt;/P&gt;&lt;P&gt;I'm trying to create an Add-in like a place text on a drawingsheet. Workflow will be, push Add-in Ribbon Button, pick a point in the sheet and then show a form. On Oke place a sketched symbol at the picked point.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;Rob.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2013 06:40:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/4305341#M133019</guid>
      <dc:creator>VdVeek</dc:creator>
      <dc:date>2013-06-21T06:40:01Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting a Point2D with your mouse on a drawing sheet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/4311458#M133020</link>
      <description>&lt;P&gt;Hi Rob,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you upload the full addin project, I can take a look and tell you what's wrong...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Philippe.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2013 13:18:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/4311458#M133020</guid>
      <dc:creator>philippe.leefsma</dc:creator>
      <dc:date>2013-06-27T13:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting a Point2D with your mouse on a drawing sheet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/4313872#M133021</link>
      <description>&lt;P&gt;Philippe, I got it working after a lot of work. Seems like this part of code in the Class (&lt;SPAN&gt;clsGetPoint)&lt;/SPAN&gt; worked for me:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Public Sub PickPoint()&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Do&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;pnt = GetDrawingPoint("Click the desired location.", MouseButtonEnum.kLeftMouseButton)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;If Not pnt Is Nothing Then&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;'if pnt is filled then add a refernece to the form&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Dim oForm As InvForm&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;oForm = New InvForm()&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;'check if the InvForm is already running. If not open the form&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;For Each form In System.Windows.Forms.Application.OpenForms&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;If oForm.Name = "InvForm" Then&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;oForm.Show()&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;oForm = Nothing&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;End If&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Next&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;End If&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Loop While Not pnt Is Nothing&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;End Sub&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;Now in my add-in i first run the Class to run the PickPoint function, and after the user picked a point my Form starts.&lt;/P&gt;&lt;P&gt;In InvForm I&amp;nbsp;&lt;EM&gt;Imports QRsketchsymbol.clsGetPoint,&amp;nbsp;&lt;/EM&gt;and i read the value of the pick point (pnt) with:&lt;/P&gt;&lt;P&gt;'Insert the sketched symbol on the active sheet.&lt;BR /&gt;oSkSym = oDwg.ActiveSheet.SketchedSymbols.Add(symbolname, oTG.CreatePoint2d(CDbl(pnt.X), CDbl(pnt.Y)))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rob.&lt;/P&gt;</description>
      <pubDate>Sat, 29 Jun 2013 18:56:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/4313872#M133021</guid>
      <dc:creator>VdVeek</dc:creator>
      <dc:date>2013-06-29T18:56:22Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting a Point2D with your mouse on a drawing sheet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/4315416#M133022</link>
      <description>&lt;P&gt;I'm glad you could solve it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Philippe.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2013 13:06:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/4315416#M133022</guid>
      <dc:creator>philippe.leefsma</dc:creator>
      <dc:date>2013-07-01T13:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting a Point2D with your mouse on a drawing sheet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/5495997#M133023</link>
      <description>&lt;P&gt;This code is great! Exactly what I’m looking for to help add a function to my drawing template.&lt;/P&gt;&lt;P&gt;The only issue I am having is that I cannot run the code from a user command button in inventor.&lt;/P&gt;&lt;P&gt;I can run the code from with in the visual basic editor.&amp;nbsp; But if&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;otherwise it will not get past the line&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Set pnt = getPoint.GetDrawingPoint("Click the desired location", kLeftMouseButton)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;In the sub. If I run it from&amp;nbsp;inventor the&amp;nbsp;cursor becomes stuck with the plus sign on it and the only way to get out of the loop is to have the VB editor already open and use the&amp;nbsp;reset command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can you offer any help in resolving this as&amp;nbsp;I&amp;nbsp;have&amp;nbsp;had no luck thus far.&lt;/P&gt;&lt;P&gt;(I do realise how old this post is, but nothing ventured nothing gained.)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am jumping between inventor 2013 &amp;amp; 2015&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;</description>
      <pubDate>Thu, 05 Feb 2015 12:26:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/5495997#M133023</guid>
      <dc:creator>Nsteel</dc:creator>
      <dc:date>2015-02-05T12:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting a Point2D with your mouse on a drawing sheet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/6755344#M133024</link>
      <description>&lt;P&gt;did you ever get this working in vb.net? I seem to have the same issue where it gets stuck in a loop....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nacho&lt;/P&gt;</description>
      <pubDate>Sat, 17 Dec 2016 00:32:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/6755344#M133024</guid>
      <dc:creator>NachoShaw</dc:creator>
      <dc:date>2016-12-17T00:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting a Point2D with your mouse on a drawing sheet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/6755354#M133025</link>
      <description>&lt;P&gt;Brian / Phillipe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have a working vb.net version? I can get this to work fine in VBA and my MouseEvent returns the mouse position but in VB.Net, nothing works. I get the interaction Prompt but that is it...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nacho&lt;/P&gt;</description>
      <pubDate>Sat, 17 Dec 2016 00:42:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/6755354#M133025</guid>
      <dc:creator>NachoShaw</dc:creator>
      <dc:date>2016-12-17T00:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting a Point2D with your mouse on a drawing sheet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/6868332#M133026</link>
      <description>&lt;P&gt;Is there any solution or working example for VB.Net?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Georg&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2017 09:38:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/6868332#M133026</guid>
      <dc:creator>GeorgK</dc:creator>
      <dc:date>2017-02-10T09:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting a Point2D with your mouse on a drawing sheet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/6868360#M133027</link>
      <description>&lt;P&gt;Nope, not that I found mate. All I know is-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;works just fine in VBA&lt;/P&gt;&lt;P&gt;Does not work in VB.Net&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nacho&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2017 09:54:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/6868360#M133027</guid>
      <dc:creator>NachoShaw</dc:creator>
      <dc:date>2017-02-10T09:54:40Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting a Point2D with your mouse on a drawing sheet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/6868364#M133028</link>
      <description>&lt;P&gt;Hey, do you mean VB.Net (e.g.: AddIn, external application) or iLogic?&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2017 09:57:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/6868364#M133028</guid>
      <dc:creator>Owner2229</dc:creator>
      <dc:date>2017-02-10T09:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting a Point2D with your mouse on a drawing sheet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/6868369#M133029</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was referring to VB.Net being used to create an Addin and the function doesn't work in VB.Net&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;cheers&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2017 10:01:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/6868369#M133029</guid>
      <dc:creator>NachoShaw</dc:creator>
      <dc:date>2017-02-10T10:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting a Point2D with your mouse on a drawing sheet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/6868410#M133030</link>
      <description>&lt;P&gt;this is the code where I call the mouse action (It is a simplified version of Detailed view, only 2 clicks instead of 10)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you copy paste it into VBA it should just work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The main issue with this code is that if the user cancel in between the 2 mouse clicks it won't stop the macro from running. This can cause issue's later on. I'm still searching for a fix for this. If you would be able to help, this would be very usefull &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;chris&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Public Sub AutoDetailedView()&lt;BR /&gt;&lt;BR /&gt;'step 1 Select a drawingView&lt;BR /&gt; 'Set a reference to the drawing document.&lt;BR /&gt; Dim oDrawDoc As DrawingDocument&lt;BR /&gt; Set oDrawDoc = ThisApplication.ActiveDocument&lt;BR /&gt;&lt;BR /&gt; 'Set a reference to the active sheet.&lt;BR /&gt; Dim oSheet As Sheet&lt;BR /&gt; Set oSheet = oDrawDoc.ActiveSheet&lt;BR /&gt; &lt;BR /&gt; ' Select a drawing view&lt;BR /&gt; Dim oDrawingView As DrawingView&lt;BR /&gt; Set oDrawingView = oSheet.DrawingViews.Item(1)&lt;BR /&gt; &lt;BR /&gt; 'select the below if you want the user to choose a drawing view, else the above will select the first drawingview on the active sheet&lt;BR /&gt; 'Set oDrawingView = ThisApplication.CommandManager.Pick(kDrawingViewFilter, "Select a drawing view.")&lt;BR /&gt;&lt;BR /&gt;'step 2 Select the center of the circular fence&lt;BR /&gt; Dim getPoint As New clsGetPoint&lt;BR /&gt; Dim oCenterPoint As Point2d&lt;BR /&gt; Set oCenterPoint = getPoint.GetDrawingPoint("Select the area to be detailed", kLeftMouseButton, kCursorBuiltInCursorSelTrail)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;'step 3 Select the place where the detailed view need to be placed&lt;BR /&gt; Dim oPoint As Point2d&lt;BR /&gt; Set oPoint = getPoint.GetDrawingPoint("Select the location of the detailed view", kLeftMouseButton, kCursorBuiltInPushpinCursor)&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; ' Get any linear curve from the base view&lt;BR /&gt; Dim oCurve As DrawingCurve&lt;BR /&gt; For Each oCurve In oDrawingView.DrawingCurves&lt;BR /&gt; If oCurve.CurveType = kLineSegmentCurve Then Exit For&lt;BR /&gt; Next&lt;BR /&gt; &lt;BR /&gt; ' Create an intent object&lt;BR /&gt; Dim oAttachPoint As Point2d&lt;BR /&gt; Set oAttachPoint = oDrawingView.Center&lt;BR /&gt; &lt;BR /&gt;'step 4 Create the detail view&lt;BR /&gt; Dim oDetailView As DetailDrawingView&lt;BR /&gt; Set oDetailView = oSheet.DrawingViews.AddDetailView(oDrawingView, oPoint, kShadedDrawingViewStyle, True, oCenterPoint, 1, , "1/3", False, " ")&lt;BR /&gt; 'Set breakline to smooth&lt;BR /&gt; oDetailView.IsBreakLineSmooth = True&lt;BR /&gt; 'Show full detail boundary&lt;BR /&gt; oDetailView.DisplayFullBoundary = True&lt;BR /&gt; 'Show connection line&lt;BR /&gt; oDetailView.DisplayConnectionLine = True&lt;BR /&gt;&lt;BR /&gt; 'set detailview to "Parts"&lt;BR /&gt; ' this assumes that there is an detailview called "Parts", if not, delete this line&lt;BR /&gt; 'Call oDetailView.SetDesignViewRepresentation("Parts", False)&lt;BR /&gt; &lt;BR /&gt; 'set rastview off (new since 2014)&lt;BR /&gt; oDetailView.IsRasterView = False&lt;BR /&gt; &lt;BR /&gt;'step 5 Active top level of drawing (error handling 2013/02/18)&lt;BR /&gt;ErrorManagment: '(error handling 2013/02/18)&lt;BR /&gt; oSheet.Activate&lt;BR /&gt;&lt;BR /&gt;End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You also need to create a class module called clsGetPoint:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 151px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/321366iE6D623495F7B313A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Private WithEvents m_interaction As InteractionEvents
Private WithEvents m_mouse As MouseEvents
'Private WithEvents m_Key As KeyboardEvents
Private m_position As Point2d
Private m_button As MouseButtonEnum
Private m_continue As Boolean


Public Function GetDrawingPoint(Prompt As String, button As MouseButtonEnum, m_Cursor As CursorTypeEnum) As Point2d
    Set m_position = Nothing
    m_button = button
    
    Set m_interaction = ThisApplication.CommandManager.CreateInteractionEvents
    Set m_mouse = m_interaction.MouseEvents
   ' Set m_Key = m_interaction.KeyboardEvents
       
    m_interaction.StatusBarText = Prompt
    m_interaction.SetCursor (m_Cursor)
    m_interaction.Start
    
    m_continue = False
    Do
        ThisApplication.UserInterfaceManager.DoEvents
   
    Loop Until m_continue
    
    m_interaction.Stop
   
    Set GetDrawingPoint = m_position
End Function

Private Sub m_mouse_OnMouseClick(ByVal button As MouseButtonEnum, ByVal ShiftKeys As ShiftStateEnum, ByVal ModelPosition As Point, ByVal ViewPosition As Point2d, ByVal View As View)
    If button = m_button Then
        Set m_position = ThisApplication.TransientGeometry.CreatePoint2d(ModelPosition.x, ModelPosition.y)
       m_continue = True
    End If
         
End Sub

'Private Sub m_Key_KeyPress(KeyAscii As Integer)
'If KeyAscii = 27 Then

   'm_continue = False
   'End If
'End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2017 10:20:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/6868410#M133030</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-10T10:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting a Point2D with your mouse on a drawing sheet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/6868500#M133031</link>
      <description>&lt;P&gt;The code is working in VBA but not in VB.Net for an Add-in.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2017 11:06:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/6868500#M133031</guid>
      <dc:creator>GeorgK</dc:creator>
      <dc:date>2017-02-10T11:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting a Point2D with your mouse on a drawing sheet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/6869404#M133032</link>
      <description>&lt;P&gt;It does work in VB.NET. &amp;nbsp;I've attached a small sample add-in project that demonstrates it. &amp;nbsp;When the add-in is loaded there will be a new command in the Drawing environment and when you run it, you can click anywhere on the sheet and then it will display the coordinates of the click.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2017 16:29:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/6869404#M133032</guid>
      <dc:creator>ekinsb</dc:creator>
      <dc:date>2017-02-10T16:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting a Point2D with your mouse on a drawing sheet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/6873578#M133033</link>
      <description>&lt;P&gt;Hello Brian,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks. That's working.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Georg&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2017 11:53:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/6873578#M133033</guid>
      <dc:creator>GeorgK</dc:creator>
      <dc:date>2017-02-13T11:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting a Point2D with your mouse on a drawing sheet</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/7328515#M133034</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did anyone manage to get this working with a external VB.Net project, have tried with both solutions posted on here but keep getting stuck in the loop. I would appreciate, any help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 663px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/394200iBE4BCDF6BFFA9147/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;    Public Function GetDrawingPoint(Prompt As String, button As MouseButtonEnum) As Point2d
        m_position = Nothing
        m_button = button
        m_interaction = oApp.CommandManager.CreateInteractionEvents
        m_mouse = m_interaction.MouseEvents
        m_interaction.StatusBarText = Prompt
        m_interaction.Start()
        m_continue = True
        Do
            oApp.UserInterfaceManager.DoEvents() 'DoEvents
        Loop While m_continue
        m_interaction.Stop()
        GetDrawingPoint = m_position
    End Function&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Aug 2017 11:06:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/selecting-a-point2d-with-your-mouse-on-a-drawing-sheet/m-p/7328515#M133034</guid>
      <dc:creator>paul.hurley</dc:creator>
      <dc:date>2017-08-25T11:06:35Z</dc:date>
    </item>
  </channel>
</rss>

