IADSession.PreviewSnapshot
Has anyone been able to get IADSession.PreviewSnapshot to work without throwing an exception? I'm running Alibre Design 10, and writing a program in C#.
Accessing the IADSession.PreviewSnapshot throws the following exception -
System.Runtime.InteropServices.COMException was unhandled
Message="Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))"
Source="Interop.AlibreX"
ErrorCode=-2147418113
StackTrace:
at AlibreX.IADSession.get_PreviewSnapshot()
at AlibreSnapshot.AlibreSnapshot.getPreviewSnapshot() in C:\\Users\\...
The following C# code reproduces the error -
AutomationHook hook;
IADRoot root;
IADSessions sessions;
IADSession session;
object oPicture;
//hook = (AutomationHook)Marshal.GetActiveObject("AlibreX.AutomationHook");
hook = new AlibreX.AutomationHook();
hook.Initialize("", "", "", true, 0);
root = (IADRoot)adHook.Root;
root.OpenFile(@"C:\\temp\\8020-1515-Model.ad_prt");
sessions = root.Sessions;
session = sessions.Item(0);
oPicture = session.PreviewSnapshot;
Thanks,