Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
leoa.87
in reply to: Ralf_Krieg


if I put this code inside yours, I can get the basic list with the components I need (managed by other ilogic rules)
but this rule reports me an error for each subassembly that is inside.

(Rule error: Parameters xxx.iam, document: xxx.iam

Component.IsActive: Could not change the suppression status of the lining component xxx: 1.
The active level of detail in xxx is not a custom level of detail.

giving ok. it goes on and carries out the export of the list but it is very annoying.

how could i solve?

 

 

Dim oDock As Document = ThisDoc.Document
Dim oAsmCompDef As AssemblyComponentDefinition = oDock.ComponentDefinition
oAsmCompDef.RepresentationsManager.DesignViewRepresentations.Item("Principale").activate
oDock.ComponentDefinition.RepresentationsManager.LevelofDetailRepresentations("Principale").activate



Dim ExportSheet = sFolder  & "\"  & "Parts Only " & Parameter("d109") & ".xls"

'oAsmDoc = ThisApplication.ActiveDocument
Dim oBOM As BOM
oBOM = oDoc.ComponentDefinition.BOM


'' Export the BOM view 
Dim oPartsOnlyBOMView As BOMView
oPartsOnlyBOMView = oBOM.BOMViews.Item("Solo parti")
oPartsOnlyBOMView.Export(ExportSheet, kMicrosoftExcelFormat)


Try
oAsmCompDef.RepresentationsManager.DesignViewRepresentations.Item("View1").activate 
Catch
oAsmCompDef.RepresentationsManager.DesignViewRepresentations.Add("View1")
End Try
Try
oDock.ComponentDefinition.RepresentationsManager.LevelofDetailRepresentations("Livello di dettaglio1").activate
Catch
oDock.ComponentDefinition.RepresentationsManager.LevelofDetailRepresentations.Add("Livello di dettaglio1")
End Try