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: 

HELP to get a snapshot of an .ipt file inside Inventor

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
DaviPregna
868 Views, 2 Replies

HELP to get a snapshot of an .ipt file inside Inventor

Hi to everybody

I'm developing a VB.NET framework 4.0 that must works with Inventor 2013 and Vault.

 

My *BIG* problem is to obtain a simply image (bmp, jpeg, whatever you want) of the ActiveDocument in Inventor when the user add the file inside Vault (VaultCheckinTop) - my goal is to create a detail technical pdf report and store it in our database.

I'm able to create ALL (get iProperties, etc) but i cannot take a snapshot of the ActiveDocument.

I've tried both Apprentice way and ClientView way registering the old-know "InventorThumbnailViewLib", without success.

I cannot (and i don't want!!) use the VisualBasic.Compatibility method because it's ultra-deprecated, and i cannot use too the VBA scripting because my application it's create in VB.NET.

 

An idea (but i don't know how to do) is to replicate in "silent mode" at runtime the "Export to Immage" command of Inventor.

 

I have read all similar post found on the net, without success

 

http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/obtain-thumbnail-image/m-p/2664182/hig...

 

http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/Create-JPEG-of-Drawing-idw-through-Inv...

 

http://discussion.autodesk.com/thread.jspa?threadID=421943

 

Anyone has an idea? I do not have walls on which way to turn 😞

 

My scenario is: VS2K10 - Framework 4.0 - Windows 7 @ 64bit - Inventor 2K13 @ 64bit with Update 2 - last DeveloperTool @ 64bit

 

Thanks in advance

Dave

2 REPLIES 2
Message 2 of 3

Hi Dave,

 

You can try the Screenshot plug-in from the Exchange Store. It is provided with full source code and written in Vb.Net:

 

http://apps.exchange.autodesk.com/INVNTOR/2013/en/Detail/Index?id=autodesk.appstore.exchange.autodes...

 

Regards,

Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

Message 3 of 3

Hi Philippe,

thanks for the solution. Your is a good solution, but it's too heavy for a automation procedure.

I solved it grabbing first the thumbnail of the Inventor file as stdole.iPicture, and then convert it from iPicture to a valid image. This way it's the better for my scenario because i have "exactly" what Inventor stores, and at the same time the Designer must do NOTHING because the grabbing is done silently at substrate-level! (....and most of all i have no human errors 😄 )

Also i don't have problem with 32 bit/  64 bit machines and i don't need the terrible VB6.Compatibility!!!

 

Here there is my piece of code:

 

''''get the ActiveDocument Thumbnail
Dim oThumb As stdole.IPictureDisp = m_App.ActiveDocument.Thumbnail
Dim oMF As New Metafile(New IntPtr(oThumb.Handle), New WmfPlaceableFileHeader())
Dim oCallBack As New Image.GetThumbnailImageAbort(AddressOf ThumbnailCallback)
Dim org As Image = oMF.GetThumbnailImage(400, 400, oCallBack, IntPtr.Zero)

 

''''a color image
imgThumb = New Bitmap(org.Width, org.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb)
imgThumb.SetResolution(org.HorizontalResolution, org.VerticalResolution)
Dim g As Graphics = Graphics.FromImage(imgThumb)
g.DrawImage(org, 0, 0)
g.Dispose()

 

''' now imgThumb is a normal image that it can be saved, printed o loaded into a PictureBox

 

Hope this helps,

Dave

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

Post to forums  

Autodesk Design & Make Report