Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Parts list with thumbnail

1 REPLY 1
Reply
Message 1 of 2
saseendrankombath
549 Views, 1 Reply

Parts list with thumbnail

As an academic interest I was trying to convert Brian’s code for exporting Parts list with thumbnail to VB.net 2012. I just modified the below code to remove the vb6 support. I am using VS 2012 and Inventor 2014. The end result on the word report thumb nail for some parts are not visible. It goes to the error code and putting the text instead of thumb nail. At the same time Brian’s code as it is (used the exe file to install it) works fine on the same parts list with all thumb nail. Can you guide me where I went wrong?

 

#Region "PictureToImageConverter"
    Public NotInheritable Class PictureToImageConverter
        Inherits System.Windows.Forms.AxHost

        Private Sub New()
            MyBase.New(Nothing)
        End Sub

        Public Shared Function Convert(ByVal iPicture As stdole.IPictureDisp) As System.Drawing.Image
            Return CType(System.Windows.Forms.AxHost.GetPictureFromIPicture(iPicture), System.Drawing.Image)
        End Function

    End Class
#End Region



Dim thumbNailPicDisp As stdole.IPictureDisp
                        thumbNailPicDisp = refDoc.Thumbnail

                        Dim thumbNailImage As System.Drawing.Image = PictureToImageConverter.Convert(thumbNailPicDisp)
                        ' Save the thumbnail to a file.
                        Dim thumbFilename As String = System.IO.Path.GetTempPath & "tempthumbnail.bmp"
                        thumbNailImage.Save(thumbFilename)

 

1 REPLY 1
Message 2 of 2

The error description on the above code is "a generic error occurred in gdi+" . 

 

How can I correct this?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report