Is there an iLogic way to cascade assembly BOM column choice down through subassemblies?

Is there an iLogic way to cascade assembly BOM column choice down through subassemblies?

Cadderman
Enthusiast Enthusiast
415 Views
2 Replies
Message 1 of 3

Is there an iLogic way to cascade assembly BOM column choice down through subassemblies?

Cadderman
Enthusiast
Enthusiast

Hi all,

 

I understand that the assembly template model can be modified so all appropriate columns are pre-picked and ready to use.  Unfortunately the project I am working on already has a 90% complete assembly, with many subassemblies.

 

For each assembly, I have to:

  • Enable Structured BOM view
  • Choose the desired columns

This is taking quite some time.  I would like a code that enables Structured BOM view in all subassemblies.  It would then look at the top level assembly BOM and replicate the chosen columns in all subassemblies in all levels below the top level assembly.

 

Is this possible?  iLogic or not, a faster way than I am currently doing would be great.

 

 

0 Likes
Accepted solutions (1)
416 Views
2 Replies
Replies (2)
Message 2 of 3

JelteDeJong
Mentor
Mentor
Accepted solution

As far as I know, there is no direct way to change the BOM appearance by api. But itis possible to load a "Bom Customization File" You can create the file by setting up the bom as you like it and then export the configuration with this button:

JelteDeJong_0-1660420084236.png

then in the following iLogic rule you will find on the first line a path. Change that path to the location of your file.

Dim bomCustomizationFileName as String = "D:\forum\bomCustomizationFileName.xml"
Dim doc As AssemblyDocument = ThisDoc.Document

For Each refDoc As Document In doc.AllReferencedDocuments
    Try
        If (refDoc.DocumentType <> DocumentTypeEnum.kAssemblyDocumentObject) Then Continue For

        Dim bom As BOM = refDoc.ComponentDefinition.BOM
        bom.ImportBOMCustomization(bomCustomizationFileName)

    Catch ex As Exception
        MsgBox(String.Format("Something went wrong while setting up bom in file: '{0}'. Message: {1}",
            refDoc.FullFileName, ex.Message))
    End Try
Next

 

Jelte de Jong
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.

EESignature


Blog: hjalte.nl - github.com

Message 3 of 3

Cadderman
Enthusiast
Enthusiast

Thank you so much @JelteDeJong that worked great! It has saved me so much time.  I really appreciate it.

0 Likes