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: 

Fix for Inventor Thumbnails running on 64 bit PCs

17 REPLIES 17
Reply
Message 1 of 18
Gruff
3833 Views, 17 Replies

Fix for Inventor Thumbnails running on 64 bit PCs

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)

Else
  Set Pic1.Picture = oDoc.Thumbnail
End If

 

 

 

 

 

 

 

17 REPLIES 17
Message 2 of 18
3DAli
in reply to: Gruff

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

Ali

Signature_Small
Message 3 of 18
skyngu
in reply to: 3DAli

hi,

 

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

Autodesk Inventor Professional 2019
Message 4 of 18
Gruff
in reply to: Gruff

3DAli:

 
1) I do not have 2012 installed on any PC at this location so recompiling it for you is not an option.
Let me check my code and see if it is something I can change so that it will work for you.
2) I did develop an iLogic method to do the same thing but it was extremely convoluted and in the end did what the add in does.  As it was explained to me iLogic called from 32 bit VBA is still 32 bit on a 64 bit system.
 
jcneal:
 
Under Windows 7 the add in folder is under C:\ProgramData\Autodesk\Inventor 2011\Addins
You may have to turn on show hidden and system files and folders in your windows explorer folder options to see it.
I do not know where it might be hidden on an XP machine.  I suppose you could do a windows search for the:
Autodesk.TranslatorDWF.Inventor.addin 
file.
 
On the other hand I know nothing about Inventor 2010.  Did they have the addin folder with that version?
Message 5 of 18
3DAli
in reply to: Gruff

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

Sincerely

Ali

Signature_Small
Message 6 of 18
skyngu
in reply to: Gruff

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.

Autodesk Inventor Professional 2019
Message 7 of 18
Mike.Wohletz
in reply to: skyngu

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. Smiley Wink

Message 8 of 18
3DAli
in reply to: Mike.Wohletz

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.

 

Cheers

Ali

Signature_Small
Message 9 of 18
3DAli
in reply to: 3DAli

Smiley Wink it Works!!!! I cannot possibly thank you enough for this, 

 

Awesome,

Signature_Small
Message 10 of 18
3DAli
in reply to: 3DAli

just added this delay and now it runs problem free, funny though but it works,Smiley Very Happy

 

"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.
Loop

 
 
  DataObj.GetFromClipboard
  ClipGet = DataObj.GetText(1)
End Function"


Signature_Small
Message 11 of 18
skyngu
in reply to: Mike.Wohletz

hi,

 

thanks for your help. it works great on 2012.

 

where should i put addin file into for inventor 2010? on the readme, i dont see any instruction for inventor 2010

Autodesk Inventor Professional 2019
Message 12 of 18
Gruff
in reply to: skyngu

All programs for Wkndows needed to be registered for windows until recently.

When you compiled the old style DLL addin, or when the DLL was regestered with windows when you ran a program install package.  You could also manually register a program with RegSvr32.exe,.

 

Autodesk came up with the Registration Free system where you do not need to jump through those hoops.

You simply put the compiled DLL in the Inventor Bin folder and the Addin in the Addin folder. 

 

If 2010 still uses the old registration method then you do not manually move any files at all.

 

On the machine you compiled the DLL on you should be able to see it inside Inventor under the addins menu.

The same if you created an install package and installed the DLL to another PC.

 

Message 13 of 18
3DAli
in reply to: skyngu

this is where you can find addins

 

C:\Users\xxxx\AppData\Roaming\Autodesk\Inventor 2012\Addins

 

trust this helps

cheers

Ali

Signature_Small
Message 14 of 18
skyngu
in reply to: Gruff

thanks for the clarification.

 

In inventor 2010, I have to use Registration then. there will be a little more work but can be done.

 

thanks again.

Autodesk Inventor Professional 2019
Message 15 of 18
Gruff
in reply to: skyngu

P.S. Do not run VB.NET and Inventor at the same time when testing out your addin.  Close the one your not curently using.

Message 16 of 18
3DAli
in reply to: Gruff

everything stopped working in 2016! the add in can not be loaded successfully, any idea or new revision so this can be dealth with?

 

Signature_Small
Message 17 of 18
Gruff
in reply to: 3DAli

Pretty sure Autodesk went to 64 bit VBA in 2014 or 2015.  The addin is no longer needed as far as I know.

 

P.S.  64 bit VBA 7 will require you to use some new data types if you make any Windows API calls via declare statements.

 

(See) http://forums.autodesk.com/t5/inventor-customization/folder-browser-needed-for-vba-7-64-bit/m-p/4365...

Message 18 of 18
3DAli
in reply to: Gruff

Thank you Gruff, thats right, everything went back to normal now, just the way we used to do back in 32 bit days 🙂 I fixed my codes and they work just fine. I would like to share couple of cool macros that I have developed over the years with you guys , I was wondering if you can connect me to some one at Autodesk lab.

 

 

Signature_Small

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

Post to forums