I have using Inventor api to open an assembly file.But while open the .iam file it will show all the suppressed elements.how can we hide this suppressed elements from showing?
here is my code
Dim asdoc As AssemblyDocument asdoc = inventorApp.Documents.Open("F:\Arun\Master\Master_RF-VH-ZZ-0800-0500-0600.iam")
Any one help??
Solved! Go to Solution.
Solved by Mike.Wohletz. Go to Solution.
Suppressing elements will create a LOD and if you wish to open the document with the API you also will need to get the last LOD that was saved. You can do this as shown below and this is also an example that I had gotten from this forum someplace in the past. You can also look at all the LOD's and have an options box to pick what you want with a little more work as well.
Dim strFullFileName As String strFullFileName = "F:\Arun\Master\Master_RF-VH-ZZ-0800-0500-0600.iam" Dim oFileManager As FileManager oFileManager = ThisApplication.FileManager Dim strLastActiveLOD As String strLastActiveLOD = oFileManager.GetLastActiveLevelOfDetailRepresentation(strFullFileName) Dim strFullDocumentName As String strFullDocumentName = oFileManager.GetFullDocumentName(strFullFileName, strLastActiveLOD) Dim oDocOpenOptions As NameValueMap oDocOpenOptions = ThisApplication.TransientObjects.CreateNameValueMap Dim oDoc As Document oDoc = ThisApplication.Documents.OpenWithOptions(strFullDocumentName, oDocOpenOptions, True)
Thanks.... Got the solution..This will help me a lot.. and change the LOD using code its working..
there some other code I checked ,it is also working.here is the code
Dim oLOD As LevelOfDetailRepresentation
Dim oCompDef As AssemblyComponentDefinition
oCompDef = inventorApp.ActiveDocument.ComponentDefinition
oLOD = oCompDef.RepresentationsManager.LevelOfDetailRepresentations.Item(5)
oLOD.Activate()