Largely due to the efforts of Mick Deck this fix is possible.
As stated in other threads 64 bit Inventor runs VBA as a sub 32 bit process. The iPictureDisp format of the document thumbnail cannot be accessed across this barrier.
The solution is to use VBA code to cause Inventor to fire an event that we can capture with an Add-in, Inside the event we convert the thumbnail data into string data and pass it back to VBA where it is reconstitued into a stdPicture object for our use.
The Windows clipboard is used for input and output to the add-in event process.
Attached is the VB.NET project to create the add-in dll.
The standard version of VB.NET 2010 was used to create this project. If you are using VB.NET 2010 express then you will have to use Notepad to open and copy the relavent code to your express project.
If you do not need the source code then the compiled dll is under the ThumbNailFix64Bit\ThumbNailFix64Bit\bin\Release Folder in the project folders. Likewise the Autodesk.ThumbNailFix64Bit.Inventor.addin file is located under the ThumbNailFix64Bit\ThumbNailFix64Bit project folder.
As I was working with Inventor 2011 that is the version this fix addresses. If you are using 2012 then you will have to change the Inventor.Interop file to point to 2012 and recompile.
Copy the dll to your Autodesk\Inventor 2011 bin folder and the .addin file to your 2011 Addin folder.
Make sure the addin shows up in inventor when inventor is opened. Make sure the Load/Unload checkbox is checked.
Open your VBA edtor and create a new Module. I name mine bas_64bit _tools. Paste the text from the attached text file into the module. Call the Get64BitPicture(() function from anywhere inside your VBA project.
For use on both 32 bit and 64 workstations I use the the following snippet..
Set oDoc = ThisApplication.Documents.ItemByName(Path)
If ThisApplication.SoftwareVersion.Is64BitVersion Then
Set Pic1.Picture = Get64BitPicture(oDoc.FullFileName)
Set Pic1.Picture = oDoc.Thumbnail
Thanks for a lot of hardwork to fix this, may I ask for a favour, since I dont have access to VB to recompile for 2012, is there any chance that you could make this to work with inventor pro 2012 (factory design suite)? I'm in a bad situation to make it work , I'm using VBA and I badly need thumbnail , otherwise the user have serious issue to figure out which part/assembly he is dealing with when using VBA interface. I tried to use this for 2012, but it didnt work, ad it didnt even appeared in add in list, I tried to register the dll manually, it didint work either, so I guess the only way is recomplie one for 2012.
any help is appreciated in advance.
p.s. I know you spent a fair amount of time on this for a solution, how ever, I was thinking if ilogic was capable of capturing thumbnail and save it into a file as bmp or jpeg, this would considered as internal process (64bit), not a second thread or host, then it was easy to read that created image file in VBA into a image control and once you are done with it , kill it. would you mind enlighten me if I'm wrong or this would never work due to ilogic capacity?
Thanks a million
just wondering where addin folder in inventor 2010? i spent half day and can not see it. anyone can point me out? thanks
invetnor 2010 & windwo 7
Thanks a lot Gruff, I really appreciate your help and I highly value what you have done so far as I read all those back and forth between you and Autodesk gurus. just a heads up on location of addins in 2012, I found then here "C:\Program Files\Autodesk\AutoCAD Mechanical 2012\Inventor Server\Bin\Addins" its a bit odd to me though.
All the bets
thanks for reply. everything runs well in inventor 2012 and 2011.
but i have another machine with inventor 2010. I dont see any addin folder. maybe you are right, they dont have addin folder in inventor 2010. thanks again.
I have just tested this and it works fine in 2012 and should have no problems in 2011 either, as far as 2010 goes you will have to have this converted to be a non registry free add-in for that to work. I did recompile it in .NET 3.5 and attached it and the attached also works in 2012 + 1 as well.
Thanks a lot, I'm goanna try it right now, its 12:24 Toronto time, but I'm up and working on it and so excited to see it works. the older version posted previously for 2011 is giving me some problem with this runtime error code 800401d0 which it's related to clipboard, but when I hit the debug and run again it works, some times even without any problem, but some time it gives me hassle, hope the one that you just sent works fine, cause I know this is a problem with Netframe, lets see, will get back to you shortly.
just added this delay and now it runs problem free, funny though but it works,
"Public Function ClipGet() As String
' Read from the Windows Clipboard from VBA
Dim DataObj As New msforms.DataObject
Dim PauseTime, Start
PauseTime = 0.25 ' Set duration in seconds
Start = Timer ' Set start time.
Do While Timer < Start + PauseTime
DoEvents ' Yield to other processes.
ClipGet = DataObj.GetText(1)
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register
Start with some of our most frequented solutions to get help installing your software.