Message 1 of 4
ActiveLevelOfDetailRepresentation throws exception in Inventor 2012
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
The below code to get the current Level Of Detail name of an assembly, using Apprentice APIs not working on Inventor 2012 64 bit( I have not tested on Inventor 2012 32 bit).
On Inventor 2012 64 bit,(using Apprentice APIs) RepresentationsManagerPtr ->ActiveLevelOfDetailRepresentation() is throwing exception as indicated in the below code.
This used to work on Inventor 2010 and Inventor 2011.
Sample code is as below.
CString GetCurrentLODName(ApprenticeServerDocumentPtr spApprenticeDoc) { CString strCurrentLOD; AssemblyComponentDefinitionPtr spAsseyCompDef = 0; RepresentationsManagerPtr spRepsMgr = 0; LevelOfDetailRepresentationPtr spLevelOfRep = 0; if(spApprenticeDoc != 0) spAsseyCompDef = spApprenticeDoc->ComponentDefinition; if(spAsseyCompDef != 0) spRepsMgr = spAsseyCompDef->RepresentationsManager; if(spRepsMgr != 0) spLevelOfRep = spRepsMgr->ActiveLevelOfDetailRepresentation; //this line throws exception if(spLevelOfRep != NULL) { _bstr_t bstrLODName = spLevelOfRep->Name; strCurrentLOD.Format(L"%s",(LPCTSTR)bstrLODName); } return strCurrentLOD; }
Instead of Apprentice APIs, I have tried to get LOD name using Inventor APIs, and it works fine.
AssemblyDocument->ComponentDefinition->RepresentationsManager->ActiveLevelOfDetailRepresentation() works fine.
Is there any issue with getting Last LOD in Inventor 2012 64 bit, through Apprentice?
Thank you,
Rakesh