Inventor Customization

Inventor Customization

Reply
Valued Mentor
Gruff
Posts: 436
Registered: ‎11-24-2003
Message 1 of 15 (1,508 Views)

Fix for Inventor Thumbnails running on 64 bit PCs

1508 Views, 14 Replies
10-03-2011 10:53 AM

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

 

 

 

 

 

 

 

Valued Contributor
3DAli
Posts: 63
Registered: ‎10-14-2008
Message 2 of 15 (1,389 Views)

Re: Fix for Inventor Thumbnails running on 64 bit PCs

03-22-2012 02:19 PM 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

Warm Regards
Valued Mentor
jcneal
Posts: 337
Registered: ‎04-10-2010
Message 3 of 15 (1,378 Views)

Re: Fix for Inventor Thumbnails running on 64 bit PCs

03-23-2012 07:51 AM 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 2014
Autodesk Product Design Suite Standard 2014
Microsoft Office 2007 & 2013
Windows 7 64bit
Synergis Adept 2014
Visual Studio Express 2010
Valued Mentor
Gruff
Posts: 436
Registered: ‎11-24-2003
Message 4 of 15 (1,368 Views)

Re: Fix for Inventor Thumbnails running on 64 bit PCs

03-23-2012 01:05 PM 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?
Valued Contributor
3DAli
Posts: 63
Registered: ‎10-14-2008
Message 5 of 15 (1,359 Views)

Re: Fix for Inventor Thumbnails running on 64 bit PCs

03-23-2012 06:33 PM 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

Warm Regards
Valued Mentor
jcneal
Posts: 337
Registered: ‎04-10-2010
Message 6 of 15 (1,358 Views)

Re: Fix for Inventor Thumbnails running on 64 bit PCs

03-23-2012 06:54 PM 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 2014
Autodesk Product Design Suite Standard 2014
Microsoft Office 2007 & 2013
Windows 7 64bit
Synergis Adept 2014
Visual Studio Express 2010
Valued Mentor
Mike.Wohletz
Posts: 376
Registered: ‎07-29-2008
Message 7 of 15 (1,351 Views)

Re: Fix for Inventor Thumbnails running on 64 bit PCs

03-23-2012 09:06 PM in reply to: jcneal

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. :smileywink:

Valued Contributor
3DAli
Posts: 63
Registered: ‎10-14-2008
Message 8 of 15 (1,347 Views)

Re: Fix for Inventor Thumbnails running on 64 bit PCs

03-23-2012 09:27 PM 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

Warm Regards
Valued Contributor
3DAli
Posts: 63
Registered: ‎10-14-2008
Message 9 of 15 (1,346 Views)

Re: Fix for Inventor Thumbnails running on 64 bit PCs

03-23-2012 09:36 PM in reply to: 3DAli

:smileywink: it Works!!!! I cannot possibly thank you enough for this, 

 

Awesome,

Warm Regards
Valued Contributor
3DAli
Posts: 63
Registered: ‎10-14-2008
Message 10 of 15 (1,345 Views)

Re: Fix for Inventor Thumbnails running on 64 bit PCs

03-23-2012 09:42 PM in reply to: 3DAli

just added this delay and now it runs problem free, funny though but it works,:smileyvery-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"


Warm Regards
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.