- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Save snapshot of view using Apprentice
Hello,
I'm trying to write a code to create a snapshot from multiple angles of a document (ipt/iam) and save it to file.
So far I've only tried the code from the links below but on both of them I get the same exception saying:
"An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll
Additional information: Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))"
I get the same error message on both functions SaveAsBitmap and CreateImage.
https://modthemachine.typepad.com/my_weblog/2013/03/inventor-api-training-lesson-12.html - "VB.NET example that opens a part and creates a jpg file"
http://aucache.autodesk.com/au2011/sessions/5606/class_presentations/v1_CP5606-Apprentice.pdf - Function
"ImageFromCameraSample"
I am using Inventor 2015. Anyone got the examples working with Inventor 2015?
Best regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I dont think you can do that with apprentice as it's a non UI based method. That means you can only do things that does not require any visual needs. You can get thumbnails with apprentice because they already exist but in order to get what you need, an interface is needed.
Thanks
Nacho
Automation & Design Engineer
Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
While it is a non-UI based method it can still be used to show preview of a part on the UI. For example check out this article http://help.autodesk.com/view/INVNTOR/2018/ENU/?guid=GUID-06D49EB6-7871-4A1B-917F-756735B5D0E7
It supplies a window handle of a control and the preview can be drawn inside that control. I tried getting the preview from the OnPaint event but it did not work.
Also, the articles in my post show that it is possible. But either something's changed since they were written or I'm missing something obvious.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
@Anonymous,
At present, Inventor 2015 is very older version to test the scenario. Inventor 2015 installer is not available to install and test the issue.
Thanks and regards,
CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network
