<?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 Inventor Screenshot Tool in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-screenshot-tool/m-p/2684444#M143658</link>
    <description>Hi folks,&lt;BR /&gt;
&lt;BR /&gt;
For some time now I've been using a screenshot add-in (attached) similar to that posted by Kean Walmsley  [here|http://bit.ly/cpiVmk] which was created by another Autodesk developer (Xiaodong Liang) and have been attempting to make it work in a 3D environment.&lt;BR /&gt;
&lt;BR /&gt;
The output part of the tool works no problem, as it uses the Viewposition information provided by the OnMouseUp event. I have been trying to figure out the best method for getting the 3d points I need, which are perpendicular to the current view.&lt;BR /&gt;
&lt;BR /&gt;
I had thought that this sample from the API Reference would help me but so far no luck.&lt;BR /&gt;
&lt;BR /&gt;
{code}&lt;BR /&gt;
Private Sub ProjectPoint(ByVal ModelPosition As Inventor.Point, ByVal WorkPointPosition As Inventor.Point, ProjectedPoint As Inventor.Point)&lt;BR /&gt;
    &lt;BR /&gt;
    ' Set a reference to the camera object&lt;BR /&gt;
    Dim oCamera As Inventor.Camera&lt;BR /&gt;
    Set oCamera = ThisApplication.ActiveView.Camera&lt;BR /&gt;
    &lt;BR /&gt;
    Dim oVec As Vector&lt;BR /&gt;
    Set oVec = oCamera.Eye.VectorTo(oCamera.Target)&lt;BR /&gt;
    &lt;BR /&gt;
    Dim oLine As Line&lt;BR /&gt;
    Set oLine = ThisApplication.TransientGeometry.CreateLine(ModelPosition, oVec)&lt;BR /&gt;
    &lt;BR /&gt;
    ' Create the z-axis vector&lt;BR /&gt;
    Dim oZAxis As Vector&lt;BR /&gt;
    Set oZAxis = ThisApplication.TransientGeometry.CreateVector(0, 0, 1)&lt;BR /&gt;
    &lt;BR /&gt;
    ' Create a plane parallel to the X-Y plane&lt;BR /&gt;
    Dim oWPPlane As Plane&lt;BR /&gt;
    Set oWPPlane = ThisApplication.TransientGeometry.CreatePlane(WorkPointPosition, oZAxis)&lt;BR /&gt;
    &lt;BR /&gt;
    Set ProjectedPoint = oWPPlane.IntersectWithLine(oLine)&lt;BR /&gt;
End Sub&lt;BR /&gt;
{code}&lt;BR /&gt;
&lt;BR /&gt;
Can anyone shed some light on what I'm doing wrong?&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance,&lt;BR /&gt;
&lt;BR /&gt;
Alex.

Edited by: vegbruiser on May 18, 2010 12:11 PM</description>
    <pubDate>Tue, 18 May 2010 11:11:15 GMT</pubDate>
    <dc:creator>AlexFielder</dc:creator>
    <dc:date>2010-05-18T11:11:15Z</dc:date>
    <item>
      <title>Inventor Screenshot Tool</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-screenshot-tool/m-p/2684444#M143658</link>
      <description>Hi folks,&lt;BR /&gt;
&lt;BR /&gt;
For some time now I've been using a screenshot add-in (attached) similar to that posted by Kean Walmsley  [here|http://bit.ly/cpiVmk] which was created by another Autodesk developer (Xiaodong Liang) and have been attempting to make it work in a 3D environment.&lt;BR /&gt;
&lt;BR /&gt;
The output part of the tool works no problem, as it uses the Viewposition information provided by the OnMouseUp event. I have been trying to figure out the best method for getting the 3d points I need, which are perpendicular to the current view.&lt;BR /&gt;
&lt;BR /&gt;
I had thought that this sample from the API Reference would help me but so far no luck.&lt;BR /&gt;
&lt;BR /&gt;
{code}&lt;BR /&gt;
Private Sub ProjectPoint(ByVal ModelPosition As Inventor.Point, ByVal WorkPointPosition As Inventor.Point, ProjectedPoint As Inventor.Point)&lt;BR /&gt;
    &lt;BR /&gt;
    ' Set a reference to the camera object&lt;BR /&gt;
    Dim oCamera As Inventor.Camera&lt;BR /&gt;
    Set oCamera = ThisApplication.ActiveView.Camera&lt;BR /&gt;
    &lt;BR /&gt;
    Dim oVec As Vector&lt;BR /&gt;
    Set oVec = oCamera.Eye.VectorTo(oCamera.Target)&lt;BR /&gt;
    &lt;BR /&gt;
    Dim oLine As Line&lt;BR /&gt;
    Set oLine = ThisApplication.TransientGeometry.CreateLine(ModelPosition, oVec)&lt;BR /&gt;
    &lt;BR /&gt;
    ' Create the z-axis vector&lt;BR /&gt;
    Dim oZAxis As Vector&lt;BR /&gt;
    Set oZAxis = ThisApplication.TransientGeometry.CreateVector(0, 0, 1)&lt;BR /&gt;
    &lt;BR /&gt;
    ' Create a plane parallel to the X-Y plane&lt;BR /&gt;
    Dim oWPPlane As Plane&lt;BR /&gt;
    Set oWPPlane = ThisApplication.TransientGeometry.CreatePlane(WorkPointPosition, oZAxis)&lt;BR /&gt;
    &lt;BR /&gt;
    Set ProjectedPoint = oWPPlane.IntersectWithLine(oLine)&lt;BR /&gt;
End Sub&lt;BR /&gt;
{code}&lt;BR /&gt;
&lt;BR /&gt;
Can anyone shed some light on what I'm doing wrong?&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance,&lt;BR /&gt;
&lt;BR /&gt;
Alex.

Edited by: vegbruiser on May 18, 2010 12:11 PM</description>
      <pubDate>Tue, 18 May 2010 11:11:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-screenshot-tool/m-p/2684444#M143658</guid>
      <dc:creator>AlexFielder</dc:creator>
      <dc:date>2010-05-18T11:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: Inventor Screenshot Tool</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-screenshot-tool/m-p/2684445#M143659</link>
      <description>Can you describe what it is you're trying to accomplish?  I'm having trouble &lt;BR /&gt;
understanding what you need to do.&lt;BR /&gt;
-- &lt;BR /&gt;
Brian Ekins&lt;BR /&gt;
Inventor API Product Designer&lt;BR /&gt;
http://blogs.autodesk.com/modthemachine</description>
      <pubDate>Fri, 21 May 2010 22:42:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-screenshot-tool/m-p/2684445#M143659</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-05-21T22:42:15Z</dc:date>
    </item>
    <item>
      <title>Re: Inventor Screenshot Tool</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-screenshot-tool/m-p/2684446#M143660</link>
      <description>Hi Brian,&lt;BR /&gt;
&lt;BR /&gt;
This started with the "Plug-in of the month" series of posts that Kean has been posting. I suggested to him that it would be handy to have the screen shot functionality in Inventor.&lt;BR /&gt;
&lt;BR /&gt;
A couple of weeks later, a developer called Xiadong Liang contacted me with the code I attached to the OP.&lt;BR /&gt;
&lt;BR /&gt;
We have been using the tool for some time, but wanted to have the option of easily outputting screen shots from parts/assemblies without having to use a third-party tool (such as Jing, or Screenpresso)&lt;BR /&gt;
&lt;BR /&gt;
It's this functionality that I've been struggling with. The original code is designed to work in .idw files where the view is always looking at the XY plane.&lt;BR /&gt;
&lt;BR /&gt;
The code I have cobbled together still provides the screen shot function, but the selection box doesn't display correctly.&lt;BR /&gt;
&lt;BR /&gt;
I've created 2 videos showing the tool working and not working, but I'm having trouble uploading anything to YouTube etc. today.&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
&lt;BR /&gt;
Alex.</description>
      <pubDate>Mon, 24 May 2010 10:14:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-screenshot-tool/m-p/2684446#M143660</guid>
      <dc:creator>AlexFielder</dc:creator>
      <dc:date>2010-05-24T10:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: Inventor Screenshot Tool</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-screenshot-tool/m-p/2684447#M143661</link>
      <description>If you're trying to take regular ol' screenshots, you can use the regular windows shortcuts, Print Screen for everything and ALT+Print Screen for the active window.  And if you've got Office 2007 and OneNote, Windows Key + S will let you quickly save only a portion of the screen.&lt;BR /&gt;
&lt;BR /&gt;
Inside of Inventor, if all you want to do is capture the model as on your screen, what's wrong with grabbing the Application.ActiveView and calling SaveAsBitmap?&lt;BR /&gt;
&lt;BR /&gt;
This quick and dirty VBA script'll do it:&lt;BR /&gt;
{code}&lt;BR /&gt;
Sub x()&lt;BR /&gt;
    Dim a As Application&lt;BR /&gt;
    Set a = ThisApplication&lt;BR /&gt;
    Dim v As View&lt;BR /&gt;
    Set v = a.ActiveView&lt;BR /&gt;
    Call v.SaveAsBitmap("c:\temp\shot.bmp", 1024, 768)&lt;BR /&gt;
End Sub&lt;BR /&gt;
{code}&lt;BR /&gt;
&lt;BR /&gt;
If you got a custom background, it'll even snag that.  And if you want to save it in another format, you can open that image file and resave it as another format.  In .NET you can call System.Drawing.Image methods to do that.&lt;BR /&gt;
&lt;BR /&gt;
Judging from your post though, are you trying to write something that draws a selection box based on where the user clicks?  If you want to cheat, you might be able to do something tricky with Windows Forms that graphically overlays a box over Inventor that follows your mouse.  Then you can take those coordinates, relate them to the screenshot you can take from that SaveAsBitmap result (or WinAPI to take the screenshot into memory) and cut the image down using the mouse click coordinates.&lt;BR /&gt;
&lt;BR /&gt;
I'll admit though that I'm not sure if it'd be more practical than trying to make Inventor API code work with both model space and drawing space.  Just a thought though.

Edited by: peter.townsend on May 25, 2010 6:42 PM&lt;BR /&gt;
&lt;BR /&gt;
I just noticed the GetWindowExtents method on the View object.  That'd make chopping the image via an overlay much easier.</description>
      <pubDate>Tue, 25 May 2010 23:38:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-screenshot-tool/m-p/2684447#M143661</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-05-25T23:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: Inventor Screenshot Tool</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-screenshot-tool/m-p/2684448#M143662</link>
      <description>Thanks for your input Peter; I have this morning been sent the attached .vb file from my contact at Autodesk.&lt;BR /&gt;
&lt;BR /&gt;
I've yet to figure out how to integrate this code into my solution, but it looks to be quite useful. &lt;BR /&gt;
&lt;BR /&gt;
Here's the code for those of you too lazy to download the file: &lt;BR /&gt;
&lt;BR /&gt;
{code}&lt;BR /&gt;
Imports Inventor&lt;BR /&gt;
Imports System.Drawing&lt;BR /&gt;
&lt;BR /&gt;
Public Class InteractionEventsManager&lt;BR /&gt;
&lt;BR /&gt;
  Dim m_inventorApplication As Inventor.Application&lt;BR /&gt;
&lt;BR /&gt;
  Dim oCornerPt As Point2d&lt;BR /&gt;
  Dim oSize As Size&lt;BR /&gt;
&lt;BR /&gt;
  'Interaction Events&lt;BR /&gt;
  Private WithEvents m_InteractionEvents As InteractionEvents&lt;BR /&gt;
&lt;BR /&gt;
  'Mouse event&lt;BR /&gt;
  Private WithEvents m_MouseEvents As MouseEvents&lt;BR /&gt;
&lt;BR /&gt;
  'Pick event for selecting object&lt;BR /&gt;
  Dim WithEvents m_SelectEvents As SelectEvents&lt;BR /&gt;
&lt;BR /&gt;
  'flag to indicate the mouse is down&lt;BR /&gt;
  Private m_flagMouseDown As Boolean&lt;BR /&gt;
&lt;BR /&gt;
  ' start point,  for screenshot&lt;BR /&gt;
    Private m_MouseStartViewPt As Inventor.Point2d&lt;BR /&gt;
&lt;BR /&gt;
    'start point, for temporary selecting rectangle&lt;BR /&gt;
    Private m_StartModelPt As Inventor.Point&lt;BR /&gt;
&lt;BR /&gt;
    'flag to indicate screenshot is running &lt;BR /&gt;
    Dim isRunningScreenshot As Boolean&lt;BR /&gt;
&lt;BR /&gt;
    'graphics node&lt;BR /&gt;
    Dim oGiNode As GraphicsNode&lt;BR /&gt;
    'coordinate set for graphics node&lt;BR /&gt;
    Dim oCoordSet As GraphicsCoordinateSet&lt;BR /&gt;
    'color set for graphics node&lt;BR /&gt;
    Dim oColorSet As GraphicsColorSet&lt;BR /&gt;
    'Line strip Graphics&lt;BR /&gt;
    Dim oGiLineStripG As LineStripGraphics&lt;BR /&gt;
    'Line  Graphics (for Inventor 2009 only)&lt;BR /&gt;
    Dim oGiLineG As LineGraphics&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
    Public Sub New(ByVal oApp As Inventor.Application)&lt;BR /&gt;
        m_inventorApplication = oApp&lt;BR /&gt;
        oCornerPt = _&lt;BR /&gt;
        m_inventorApplication.TransientGeometry.CreatePoint2d(0, 0)&lt;BR /&gt;
        oSize = New Size()&lt;BR /&gt;
    End Sub&lt;BR /&gt;
&lt;BR /&gt;
    Public Sub DoSelectRegion( _&lt;BR /&gt;
      ByRef bmSize As Size, _&lt;BR /&gt;
      ByRef bmCornetPt As Inventor.Point2d)&lt;BR /&gt;
&lt;BR /&gt;
        StartEvent(True)&lt;BR /&gt;
        bmSize = oSize&lt;BR /&gt;
        bmCornetPt = oCornerPt&lt;BR /&gt;
    End Sub&lt;BR /&gt;
&lt;BR /&gt;
    Public Sub DoSelectObject( _&lt;BR /&gt;
      ByRef bmSize As Size, _&lt;BR /&gt;
      ByRef bmCornetPt As Inventor.Point2d)&lt;BR /&gt;
&lt;BR /&gt;
        StartEvent(False)&lt;BR /&gt;
        bmSize = oSize&lt;BR /&gt;
        bmCornetPt = oCornerPt&lt;BR /&gt;
    End Sub&lt;BR /&gt;
&lt;BR /&gt;
    Private Sub StartEvent(ByVal region_or_object As Boolean)&lt;BR /&gt;
&lt;BR /&gt;
        'start interaction event&lt;BR /&gt;
        If m_InteractionEvents Is Nothing Then&lt;BR /&gt;
            m_InteractionEvents = _&lt;BR /&gt;
              m_inventorApplication.CommandManager.CreateInteractionEvents()&lt;BR /&gt;
        Else&lt;BR /&gt;
            m_InteractionEvents.Stop()&lt;BR /&gt;
        End If&lt;BR /&gt;
&lt;BR /&gt;
        m_InteractionEvents.InteractionDisabled = False&lt;BR /&gt;
&lt;BR /&gt;
        If region_or_object Then&lt;BR /&gt;
            'get mouse event&lt;BR /&gt;
            If m_MouseEvents Is Nothing Then&lt;BR /&gt;
                m_MouseEvents = m_InteractionEvents.MouseEvents&lt;BR /&gt;
                m_MouseEvents.MouseMoveEnabled = True&lt;BR /&gt;
                m_MouseStartViewPt = _&lt;BR /&gt;
                  m_inventorApplication.TransientGeometry.CreatePoint2d(0, 0)&lt;BR /&gt;
                m_flagMouseDown = False&lt;BR /&gt;
            End If&lt;BR /&gt;
        Else&lt;BR /&gt;
            'get select event&lt;BR /&gt;
            If m_SelectEvents Is Nothing Then&lt;BR /&gt;
                m_SelectEvents = m_InteractionEvents.SelectEvents&lt;BR /&gt;
                m_SelectEvents.SingleSelectEnabled = False&lt;BR /&gt;
                m_SelectEvents.WindowSelectEnabled = True&lt;BR /&gt;
            End If&lt;BR /&gt;
        End If&lt;BR /&gt;
&lt;BR /&gt;
        m_InteractionEvents.Name = "MyScreenshot"&lt;BR /&gt;
&lt;BR /&gt;
        'start&lt;BR /&gt;
        m_InteractionEvents.Start()&lt;BR /&gt;
&lt;BR /&gt;
        Do While Not m_InteractionEvents Is Nothing&lt;BR /&gt;
            If m_inventorApplication.SoftwareVersion.Major &amp;gt; 13 Then&lt;BR /&gt;
                m_inventorApplication.UserInterfaceManager.DoEvents()&lt;BR /&gt;
            Else&lt;BR /&gt;
                System.Windows.Forms.Application.DoEvents()&lt;BR /&gt;
            End If&lt;BR /&gt;
        Loop&lt;BR /&gt;
    End Sub&lt;BR /&gt;
&lt;BR /&gt;
    Private Sub m_InteractionEvents_OnTerminate() _&lt;BR /&gt;
      Handles m_InteractionEvents.OnTerminate&lt;BR /&gt;
&lt;BR /&gt;
        m_InteractionEvents.InteractionGraphics.PreviewClientGraphics.Delete()&lt;BR /&gt;
        m_inventorApplication.ActiveView.Update()&lt;BR /&gt;
        m_flagMouseDown = False&lt;BR /&gt;
        m_InteractionEvents.Stop()&lt;BR /&gt;
        m_MouseEvents = Nothing&lt;BR /&gt;
        m_SelectEvents = Nothing&lt;BR /&gt;
        m_InteractionEvents = Nothing&lt;BR /&gt;
    End Sub&lt;BR /&gt;
&lt;BR /&gt;
    Private Sub m_MouseEvents_OnMouseDown( _&lt;BR /&gt;
      ByVal Button As Inventor.MouseButtonEnum, _&lt;BR /&gt;
      ByVal ShiftKeys As Inventor.ShiftStateEnum, _&lt;BR /&gt;
      ByVal ModelPosition As Inventor.Point, _&lt;BR /&gt;
      ByVal ViewPosition As Inventor.Point2d, _&lt;BR /&gt;
      ByVal View As Inventor.View) Handles m_MouseEvents.OnMouseDown&lt;BR /&gt;
&lt;BR /&gt;
        'if the interaction event is MyScreenshot,&lt;BR /&gt;
        'then get the view position and model position&lt;BR /&gt;
&lt;BR /&gt;
        If m_InteractionEvents.Name = "MyScreenshot" Then&lt;BR /&gt;
            m_MouseStartViewPt = ViewPosition&lt;BR /&gt;
            m_StartModelPt = ModelPosition&lt;BR /&gt;
            m_flagMouseDown = True&lt;BR /&gt;
&lt;BR /&gt;
            'clean the last graphics&lt;BR /&gt;
            m_InteractionEvents.InteractionGraphics.PreviewClientGraphics.Delete()&lt;BR /&gt;
            m_inventorApplication.ActiveView.Update()&lt;BR /&gt;
&lt;BR /&gt;
            'gi node&lt;BR /&gt;
            oGiNode = m_InteractionEvents.InteractionGraphics.PreviewClientGraphics.AddNode(1)&lt;BR /&gt;
            oCoordSet = m_InteractionEvents.InteractionGraphics.GraphicsDataSets.CreateCoordinateSet(1)&lt;BR /&gt;
&lt;BR /&gt;
            'color set&lt;BR /&gt;
            oColorSet = m_InteractionEvents.InteractionGraphics.GraphicsDataSets.CreateColorSet(1)&lt;BR /&gt;
            Call oColorSet.Add(1, 255, 0, 0)&lt;BR /&gt;
&lt;BR /&gt;
            Dim tg As TransientGeometry = m_inventorApplication.TransientGeometry&lt;BR /&gt;
            Dim tempP As Inventor.Point = tg.CreatePoint(ViewPosition.X, ViewPosition.Y, 0)&lt;BR /&gt;
&lt;BR /&gt;
            oCoordSet.Add(1, tempP)&lt;BR /&gt;
            oCoordSet.Add(2, tempP)&lt;BR /&gt;
            oCoordSet.Add(3, tempP)&lt;BR /&gt;
            oCoordSet.Add(4, tempP)&lt;BR /&gt;
            oCoordSet.Add(5, tempP)&lt;BR /&gt;
&lt;BR /&gt;
            Try&lt;BR /&gt;
                If Not oGiLineStripG Is Nothing Then&lt;BR /&gt;
                    oGiLineStripG.Delete()&lt;BR /&gt;
                    oGiLineStripG = Nothing&lt;BR /&gt;
                End If&lt;BR /&gt;
                oGiLineStripG = oGiNode.AddLineStripGraphics()&lt;BR /&gt;
                oGiLineStripG.CoordinateSet = oCoordSet&lt;BR /&gt;
                oGiLineStripG.ColorSet = oColorSet&lt;BR /&gt;
                oGiLineStripG.BurnThrough = True&lt;BR /&gt;
            Catch ex As Exception&lt;BR /&gt;
                'a problem in Inventor 2009( R13 ) with &lt;BR /&gt;
                'LineStripGraphics.BurnThrough. Use LineGraphics as workaround&lt;BR /&gt;
&lt;BR /&gt;
                If Not oGiLineG Is Nothing Then&lt;BR /&gt;
                    oGiLineG.Delete()&lt;BR /&gt;
                    oGiLineG = Nothing&lt;BR /&gt;
                End If&lt;BR /&gt;
&lt;BR /&gt;
                oGiLineG = oGiNode.AddLineGraphics()&lt;BR /&gt;
                oGiLineG.CoordinateSet = oCoordSet&lt;BR /&gt;
                oGiLineG.ColorSet = oColorSet&lt;BR /&gt;
                oGiLineG.BurnThrough = True&lt;BR /&gt;
            End Try&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
        End If&lt;BR /&gt;
    End Sub&lt;BR /&gt;
&lt;BR /&gt;
    ' version 2010-05-23: to solve the issue in Perspective View&lt;BR /&gt;
    Private Sub m_MouseEvents_OnMouseMove( _&lt;BR /&gt;
      ByVal Button As Inventor.MouseButtonEnum, _&lt;BR /&gt;
      ByVal ShiftKeys As Inventor.ShiftStateEnum, _&lt;BR /&gt;
      ByVal ModelPosition As Inventor.Point, _&lt;BR /&gt;
      ByVal ViewPosition As Inventor.Point2d, _&lt;BR /&gt;
      ByVal View As Inventor.View) Handles m_MouseEvents.OnMouseMove&lt;BR /&gt;
&lt;BR /&gt;
        'if the interaction event is MyScreenshot, draw selecting rectangle.&lt;BR /&gt;
        If m_InteractionEvents.Name = "MyScreenshot" And m_flagMouseDown Then&lt;BR /&gt;
&lt;BR /&gt;
            Dim tg As TransientGeometry = m_inventorApplication.TransientGeometry&lt;BR /&gt;
&lt;BR /&gt;
            Dim P1 As Inventor.Point = tg.CreatePoint(m_MouseStartViewPt.X, -m_MouseStartViewPt.Y, 0)&lt;BR /&gt;
            Dim P3 As Inventor.Point = tg.CreatePoint(ViewPosition.X, -ViewPosition.Y, 0)&lt;BR /&gt;
            Dim P4 As Inventor.Point = tg.CreatePoint(P1.X, P3.Y, 0)&lt;BR /&gt;
            Dim P2 As Inventor.Point = tg.CreatePoint(P3.X, P1.Y, 0)&lt;BR /&gt;
&lt;BR /&gt;
            'update coordinates&lt;BR /&gt;
&lt;BR /&gt;
            oCoordSet(1) = P1&lt;BR /&gt;
            oCoordSet(2) = P2&lt;BR /&gt;
            oCoordSet(3) = P3&lt;BR /&gt;
            oCoordSet(4) = P4&lt;BR /&gt;
            oCoordSet(5) = P1&lt;BR /&gt;
&lt;BR /&gt;
            'add line strip &lt;BR /&gt;
            If Not oGiLineStripG Is Nothing Then&lt;BR /&gt;
                oGiLineStripG.SetTransformBehavior(P1, DisplayTransformBehaviorEnum.kFrontFacingAndPixelScaling, 1)&lt;BR /&gt;
                oGiLineStripG.SetViewSpaceAnchor(P1, m_MouseStartViewPt, ViewLayoutEnum.kTopLeftViewCorner)&lt;BR /&gt;
            ElseIf Not oGiLineG Is Nothing Then&lt;BR /&gt;
                oGiLineG.SetTransformBehavior(P1, DisplayTransformBehaviorEnum.kFrontFacingAndPixelScaling)&lt;BR /&gt;
                oGiLineG.SetViewSpaceAnchor(P1, m_MouseStartViewPt, ViewLayoutEnum.kTopLeftViewCorner)&lt;BR /&gt;
            End If&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
            m_inventorApplication.ActiveView.Update()&lt;BR /&gt;
 &lt;BR /&gt;
        End If&lt;BR /&gt;
    End Sub&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
    Private Sub m_MouseEvents_OnMouseUp( _&lt;BR /&gt;
      ByVal Button As Inventor.MouseButtonEnum, _&lt;BR /&gt;
      ByVal ShiftKeys As Inventor.ShiftStateEnum, _&lt;BR /&gt;
      ByVal ModelPosition As Inventor.Point, _&lt;BR /&gt;
      ByVal ViewPosition As Inventor.Point2d, _&lt;BR /&gt;
      ByVal View As Inventor.View) Handles m_MouseEvents.OnMouseUp&lt;BR /&gt;
&lt;BR /&gt;
        'if the interaction event is MyScreenshot, create the image&lt;BR /&gt;
        If m_InteractionEvents.Name = "MyScreenshot" Then&lt;BR /&gt;
&lt;BR /&gt;
            m_InteractionEvents.InteractionGraphics.PreviewClientGraphics.Delete()&lt;BR /&gt;
            m_inventorApplication.ActiveView.Update()&lt;BR /&gt;
&lt;BR /&gt;
            If Not oGiLineStripG Is Nothing Then&lt;BR /&gt;
                oGiLineStripG.Delete()&lt;BR /&gt;
                oGiLineStripG = Nothing&lt;BR /&gt;
            End If&lt;BR /&gt;
&lt;BR /&gt;
            If Not oGiLineG Is Nothing Then&lt;BR /&gt;
                oGiLineG.Delete()&lt;BR /&gt;
                oGiLineG = Nothing&lt;BR /&gt;
            End If&lt;BR /&gt;
&lt;BR /&gt;
            'stop interaction event&lt;BR /&gt;
            m_InteractionEvents.SetCursor(CursorTypeEnum.kCursorBuiltInArrow)&lt;BR /&gt;
            m_flagMouseDown = False&lt;BR /&gt;
            m_InteractionEvents.Stop()&lt;BR /&gt;
            m_MouseEvents = Nothing&lt;BR /&gt;
            m_InteractionEvents = Nothing&lt;BR /&gt;
&lt;BR /&gt;
            'prepare size of the image region, in pixel&lt;BR /&gt;
&lt;BR /&gt;
            oSize = _&lt;BR /&gt;
              New Size( _&lt;BR /&gt;
                Math.Abs( _&lt;BR /&gt;
                  ViewPosition.X - m_MouseStartViewPt.X), _&lt;BR /&gt;
                  Math.Abs(ViewPosition.Y - m_MouseStartViewPt.Y))&lt;BR /&gt;
&lt;BR /&gt;
            If ViewPosition.X &amp;gt; m_MouseStartViewPt.X And _&lt;BR /&gt;
              ViewPosition.Y &amp;gt; m_MouseStartViewPt.Y Then&lt;BR /&gt;
&lt;BR /&gt;
                oCornerPt = m_MouseStartViewPt&lt;BR /&gt;
            ElseIf ViewPosition.X &amp;gt; m_MouseStartViewPt.X And _&lt;BR /&gt;
              ViewPosition.Y &amp;lt; m_MouseStartViewPt.Y Then&lt;BR /&gt;
&lt;BR /&gt;
                oCornerPt.X = m_MouseStartViewPt.X&lt;BR /&gt;
                oCornerPt.Y = ViewPosition.Y&lt;BR /&gt;
            ElseIf ViewPosition.X &amp;lt; m_MouseStartViewPt.X And _&lt;BR /&gt;
              ViewPosition.Y &amp;gt; m_MouseStartViewPt.Y Then&lt;BR /&gt;
&lt;BR /&gt;
                oCornerPt.X = ViewPosition.X&lt;BR /&gt;
                oCornerPt.Y = m_MouseStartViewPt.Y&lt;BR /&gt;
            Else&lt;BR /&gt;
                oCornerPt = ViewPosition&lt;BR /&gt;
            End If&lt;BR /&gt;
&lt;BR /&gt;
            'take the view position in screen, calculate&lt;BR /&gt;
            'the real pixel data of the corners&lt;BR /&gt;
&lt;BR /&gt;
            oCornerPt.X = View.Left + oCornerPt.X&lt;BR /&gt;
            oCornerPt.Y = View.Top + oCornerPt.Y&lt;BR /&gt;
        End If&lt;BR /&gt;
&lt;BR /&gt;
    End Sub&lt;BR /&gt;
&lt;BR /&gt;
  Private Sub m_SelectEvents_OnSelect( _&lt;BR /&gt;
    ByVal JustSelectedEntities As Inventor.ObjectsEnumerator, _&lt;BR /&gt;
    ByVal SelectionDevice As Inventor.SelectionDeviceEnum, _&lt;BR /&gt;
    ByVal ModelPosition As Inventor.Point, _&lt;BR /&gt;
    ByVal ViewPosition As Inventor.Point2d, _&lt;BR /&gt;
    ByVal View As Inventor.View) Handles m_SelectEvents.OnSelect&lt;BR /&gt;
&lt;BR /&gt;
    'reserved for future&lt;BR /&gt;
  End Sub&lt;BR /&gt;
&lt;BR /&gt;
End Class&lt;BR /&gt;
{code}&lt;BR /&gt;
&lt;BR /&gt;
I understand that the above code will form part of a plug-in on the Autodesk labs website shortly.</description>
      <pubDate>Wed, 26 May 2010 09:08:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-screenshot-tool/m-p/2684448#M143662</guid>
      <dc:creator>AlexFielder</dc:creator>
      <dc:date>2010-05-26T09:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: Inventor Screenshot Tool</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-screenshot-tool/m-p/2684449#M143663</link>
      <description>I've figured out how to implement it.  Before I discuss how to implement it, you need a little background information first.  This programming is currently only capable of drawing the region rectangle as you drag &amp;amp; drop but it does NOT contain the code to make the capture so I added it to InteractionEventsManager.vb (see comments and code below). They've put in some intrastructure for object preselection but no guts (yet) for capturing.  They have two Public Subs you can to execute: DoSelectRegion and DoSelectObject.  However, I can't figure out why they have arguments (Size and Inventor.Point2d).  From what I can tell, these 2 parameters are calculated as you select the corners of the region.  I was able to supply arguments and it worked (commented out code below).  I noticed DoSelectRegion and DoSelectObject both use the Private Sub StartEvent which as an Boolean argument that determines if the code is to process a region (True) or selected objects (False).  So I changed StartEvent from Private to Public so I could execute it from the button's code (below) in StandardAddInServer.vb (main addin file)&lt;BR /&gt;
&lt;BR /&gt;
Implementation:&lt;BR /&gt;
&lt;BR /&gt;
InteractionEventsManager.vb is a Class module.  You add InteractionEventsManager.vb to your addin then create a button with the code below which starts the screen shot programming (which waits for you to drag &amp;amp; drop oppsing corners of the region).  If you want to execute StartEvent, you must make it Public first otherwise use the code below for DoSelectRegion.&lt;BR /&gt;
&lt;BR /&gt;
{code}&lt;BR /&gt;
        Private Sub moBtnDef_ScreenShot_OnExecute(ByVal Context As Inventor.NameValueMap) Handles moBtnDef_ScreenShot.OnExecute&lt;BR /&gt;
            Dim oScreenShot As New InteractionEventsManager(goInvApp)&lt;BR /&gt;
            'oScreenShot.DoSelectRegion(New System.Drawing.Size, goInvApp.TransientGeometry.CreatePoint2d(0, 0))&lt;BR /&gt;
            oScreenShot.StartEvent(True)&lt;BR /&gt;
        End Sub&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
'Add this to the top of InteractionEventsManager.vb&lt;BR /&gt;
Imports System.Drawing.Imaging&lt;BR /&gt;
&lt;BR /&gt;
'Add the follow to m_MouseEvents_OnMouseUp right after the line:  oCornerPt.Y = View.Top + oCornerPt.Y&lt;BR /&gt;
&lt;BR /&gt;
            Dim bmp As Bitmap = New Bitmap(oSize.Width, oSize.Height, PixelFormat.Format32bppArgb)&lt;BR /&gt;
            Dim gfx As Graphics = Graphics.FromImage(bmp)&lt;BR /&gt;
            gfx.CopyFromScreen(oCornerPt.X, oCornerPt.Y, 0, 0, oSize, CopyPixelOperation.SourceCopy)&lt;BR /&gt;
            System.Windows.Forms.Clipboard.SetImage(bmp)&lt;BR /&gt;
&lt;BR /&gt;
            Dim ofileDlg As System.Windows.Forms.SaveFileDialog = _&lt;BR /&gt;
                New System.Windows.Forms.SaveFileDialog&lt;BR /&gt;
            ofileDlg.Filter = " files" + "(*." + "jpg" + ")|*." + "jpg" + "|All files (*.*)|*.*"&lt;BR /&gt;
&lt;BR /&gt;
            If ofileDlg.ShowDialog() = DialogResult.OK Then&lt;BR /&gt;
                bmp.Save(ofileDlg.FileName)&lt;BR /&gt;
            End If&lt;BR /&gt;
&lt;BR /&gt;
{code}&lt;BR /&gt;
&lt;BR /&gt;
When Autodesk finishes the code for the object selection, I hope they post it (or a link to it) in this discussion group.

Edited by: cadfish1 on May 26, 2010 5:00 PM</description>
      <pubDate>Wed, 26 May 2010 17:00:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-screenshot-tool/m-p/2684449#M143663</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-05-26T17:00:12Z</dc:date>
    </item>
    <item>
      <title>Re: Inventor Screenshot Tool</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-screenshot-tool/m-p/2684450#M143664</link>
      <description>I've also figured out (with help from other threads) how to make the background white for the capture then set it back when done.  The code below goes in m_MouseEvents_OnMouseUp.  The first line of code below shows you the placement.  Replace everything below this line in the code I supplied before with the code after this line below.  Works great, I love it.  Thanks guys.  I can't wait until Autodesk finishes the preseleted object captures.&lt;BR /&gt;
{code}&lt;BR /&gt;
            oCornerPt.Y = View.Top + oCornerPt.Y&lt;BR /&gt;
&lt;BR /&gt;
            Dim oSheetSettings As SheetSettings = Nothing&lt;BR /&gt;
            Dim oColor As Inventor.Color = Nothing&lt;BR /&gt;
            Dim oColorSchemes As ColorSchemes = Nothing&lt;BR /&gt;
            Dim oColorScheme As ColorScheme = Nothing&lt;BR /&gt;
            Dim lBackgroundType As BackgroundTypeEnum&lt;BR /&gt;
            If m_inventorApplication.ActiveDocument.DocumentType = DocumentTypeEnum.kDrawingDocumentObject Then&lt;BR /&gt;
                oSheetSettings = m_inventorApplication.ActiveDocument.SheetSettings&lt;BR /&gt;
                oColor = oSheetSettings.SheetColor&lt;BR /&gt;
                oSheetSettings.SheetColor = m_inventorApplication.TransientObjects.CreateColor(255, 255, 255)  'White&lt;BR /&gt;
            Else&lt;BR /&gt;
                oColorSchemes = m_inventorApplication.ColorSchemes&lt;BR /&gt;
                oColorScheme = m_inventorApplication.ActiveColorScheme&lt;BR /&gt;
                lBackgroundType = oColorSchemes.BackgroundType&lt;BR /&gt;
                oColorSchemes.Item("Presentation").Activate()&lt;BR /&gt;
                oColorSchemes.BackgroundType = BackgroundTypeEnum.kOneColorBackgroundType&lt;BR /&gt;
            End If&lt;BR /&gt;
            m_inventorApplication.ActiveView.Update()&lt;BR /&gt;
&lt;BR /&gt;
            Dim bmp As Bitmap = New Bitmap(oSize.Width, oSize.Height, PixelFormat.Format32bppArgb)&lt;BR /&gt;
            Dim gfx As Graphics = Graphics.FromImage(bmp)&lt;BR /&gt;
            gfx.CopyFromScreen(oCornerPt.X, oCornerPt.Y, 0, 0, oSize, CopyPixelOperation.SourceCopy)&lt;BR /&gt;
&lt;BR /&gt;
            System.Windows.Forms.Clipboard.SetImage(bmp)&lt;BR /&gt;
&lt;BR /&gt;
            Dim ofileDlg As System.Windows.Forms.SaveFileDialog = _&lt;BR /&gt;
                New System.Windows.Forms.SaveFileDialog&lt;BR /&gt;
            ofileDlg.Title = "On the Clipboard too"&lt;BR /&gt;
            ofileDlg.Filter = "JPEG files" + "(*." + "jpg" + ")|*." + "jpg" + "|All files (*.*)|*.*"&lt;BR /&gt;
            If ofileDlg.ShowDialog() = DialogResult.OK Then&lt;BR /&gt;
                bmp.Save(ofileDlg.FileName)&lt;BR /&gt;
            End If&lt;BR /&gt;
&lt;BR /&gt;
            If m_inventorApplication.ActiveDocument.DocumentType = DocumentTypeEnum.kDrawingDocumentObject Then&lt;BR /&gt;
                oSheetSettings.SheetColor = oColor&lt;BR /&gt;
            Else&lt;BR /&gt;
                m_inventorApplication.ColorSchemes.Item(oColorScheme.Name).Activate()&lt;BR /&gt;
                oColorSchemes.BackgroundType = lBackgroundType&lt;BR /&gt;
            End If&lt;BR /&gt;
{code}</description>
      <pubDate>Wed, 26 May 2010 19:57:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-screenshot-tool/m-p/2684450#M143664</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-05-26T19:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: Inventor Screenshot Tool</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-screenshot-tool/m-p/2684451#M143665</link>
      <description>Thanks for your efforts Cadfish, I figured it was something simple I was missing. (Implementing the class I posted) &lt;BR /&gt;&lt;BR /&gt;
I also like the "Set background to white" functionality too. Good work. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;
I'm not using it yet, but I believe Inventor 2011 allows you more customisation of view styles, so I guess it would be possible to standardize the output style from within this tool?&lt;BR /&gt;&lt;BR /&gt;
I hope to install IV2011 in the next few days so will have the opportunity to test the above statement.</description>
      <pubDate>Thu, 27 May 2010 10:01:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-screenshot-tool/m-p/2684451#M143665</guid>
      <dc:creator>AlexFielder</dc:creator>
      <dc:date>2010-05-27T10:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: Inventor Screenshot Tool</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-screenshot-tool/m-p/2684452#M143666</link>
      <description>You're welcome but I did it for selfish reasons.  We create a lot of PowerPoint presenations which uses screen captures from Inventor (sometimes 100+ per presentation) so this will save us a few clicks per capture.  Thank you for sharing.&lt;BR /&gt;
&lt;BR /&gt;
What do you mean by "customization of view styles"?  If you mean background color and style (gradient, 1 color, etc) then yes you can set it how you like.  I would think you'd offer another command (button - form) for the user to select the color and style and save that somewhere (SaveSetting) for the screen capture code to utilize (GetSetting).&lt;BR /&gt;
&lt;BR /&gt;
If you need help getting it going, let me know (beebema@westinghouse.com).</description>
      <pubDate>Thu, 27 May 2010 12:20:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-screenshot-tool/m-p/2684452#M143666</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-05-27T12:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: Inventor Screenshot Tool</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-screenshot-tool/m-p/2684453#M143667</link>
      <description>It sounds like you would really benefit from using Autodesk Inventor Publisher - especially as PowerPoint is one of the formats it's capable of outputting to.&lt;BR /&gt;
&lt;BR /&gt;
We had access to the Technology Preview and found it lacking in a number of areas, and having seen the trial version, I'm happy to say it's been improved somewhat since the TP. We don't yet have enough future work to make purchasing a copy viable, but what we have shown our client so far has been very well received.&lt;BR /&gt;
&lt;BR /&gt;
Getting back on topic; I've seen a few videos posted by Rob Cohee that show AutoCAD-style shading &amp;amp; (I think) rendering within the Inventor window.&lt;BR /&gt;
&lt;BR /&gt;
In fact, here's a link to one of them: http://bit.ly/aA3RFn (There are a few more available if you click through to YouTube)&lt;BR /&gt;
&lt;BR /&gt;
I hadn't considered adding a button to set the screenshot "style" - If I did do that I'd maybe try and make it function the same as the other tool I've been working on which allows you to create two Inventor drawings using the same drawing block; I did this because our client requires us to send them specific drawing borders (which are IMHO pretty crappy), whereas ours are a lot simpler/cleaner/use nicer fonts and we can send them to potential suppliers without giving away who our client is.</description>
      <pubDate>Thu, 27 May 2010 13:11:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-screenshot-tool/m-p/2684453#M143667</guid>
      <dc:creator>AlexFielder</dc:creator>
      <dc:date>2010-05-27T13:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: Inventor Screenshot Tool</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-screenshot-tool/m-p/2684454#M143668</link>
      <description>Thanks I'll check it out.&lt;BR /&gt;
&lt;BR /&gt;
I've added a few bells &amp;amp; whistles and from a problem I can't track down (see attached code).  Note that I've changed the file name from your original and changed all the names of the module level variables to match my standard nomenclature.&lt;BR /&gt;
&lt;BR /&gt;
The problem is, if the user left clicks down, does NOT move the mouse then lets up on the left mouse button, the Select &amp;gt; Priorty in inventor doesn't work.  Meaning, you can't select anything after that.  If you either execute the screen shot again but this time make a vaild window (down and up points are different) or if you Select &amp;gt; priority (select the same priority that is already set) then Inventor's select priority works again (you can select things again).  I put in an error handler and some bread crumbs (number variable - sLoc) so you can see where it fails.  It fails at the following line (because the Width and Height are both zero because the opposing corners of the rectangle are the same point - i.e. the image is 0x0 pixels):&lt;BR /&gt;
&lt;BR /&gt;
Dim bmp As Bitmap = New Bitmap(moSize.Width, moSize.Height, PixelFormat.Format32bppArgb)  &lt;BR /&gt;
&lt;BR /&gt;
Your version will fail too but you won't receive an error message because you don't have an error handler and because it's an addin (VBA and external app type would display and error message).  If Autodesk is going to suppliy this code (when finished) in Autodesk Labs, I would fix this problem If I were them (support calls just waiting to happen).  Whether they do or not, I would sure like to know how to fix this problem.</description>
      <pubDate>Thu, 27 May 2010 17:35:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-screenshot-tool/m-p/2684454#M143668</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-05-27T17:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: Inventor Screenshot Tool</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-screenshot-tool/m-p/2684455#M143669</link>
      <description>I found the Select Priority problem which is in StartEvent.  Actually it turns out not to be related at all to Select Priority, just a symptom.  The code below was causing a infinite loop (StartEvent never ends). Comment out the following code like you see here.  At first this code was causing a problem I only saw to the user clicked up and down on the same point (0x0 pixel image) however making many modification/enhancments, the code cuased the problem all the time (huh?).  &lt;BR /&gt;
&lt;BR /&gt;
I works wonderfully now!  I do have a toolbar button for it but I've also added a shortcut (Alt+Z).&lt;BR /&gt;
&lt;BR /&gt;
{code}&lt;BR /&gt;
        'Do While Not moInteractionEvents Is Nothing&lt;BR /&gt;
        '    If moInventorApp.SoftwareVersion.Major &amp;gt; 13 Then&lt;BR /&gt;
        '        moInventorApp.UserInterfaceManager.DoEvents()&lt;BR /&gt;
        '    Else&lt;BR /&gt;
        '        System.Windows.Forms.Application.DoEvents()&lt;BR /&gt;
        '    End If&lt;BR /&gt;
        'Loop&lt;BR /&gt;
{code}</description>
      <pubDate>Fri, 28 May 2010 17:23:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-screenshot-tool/m-p/2684455#M143669</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-05-28T17:23:17Z</dc:date>
    </item>
  </channel>
</rss>

