This file contains the information for creating the BOM: the fields to be displayed, the key attributes for the sum of quantities, etc. ...

From TOP version 13, its editing is done through the command interface "BOM Editor", which provides the user with an intuitive management tool. This is the reason why the manual editing process described here below has to be considered deprecated.

Here are defined the parameters for the generation of a BOM on Hierarchical Levels and of a Bill of Materials, both based on the CODE key field:

[bom.idx]
         bom1=Livels BOM From Code bom2=Base BOM From Code [bom1] group=$lev,codice sum=qta attrib=-name
         $lev -prompt "Liv." -indent attrib=-name Code attrib=-name
         Descrption attrib=-name qta -dval 1 [bom2] group=codice qtamult=1 sum=qta
         attrib=-name Code attrib=-name Description attrib=-name qta -dval
         1

Let us consider the meaning of the words within each bill of materials by studying the Layers BOM by Code (Bom1):

group=$lev,codice

The group voice defines one or more key fields for the sum of the drawing parts; in our case all the parts that have the same father part and the same drawing code are added.

sum=qta

The sum voice defines the attribute that is added by the bill of materials according to the key fields defined by the group voice.

attrib=-name $lev -prompt "Liv." -indent

The attrib voice defines the attribute that appears in the bill of materials; in this example it is displayed the hierarchical level of the part indented according to the depth of the layer.

attrib=-name Code

In this example, the Code attribute of the part is displayed in the bill of materials.

attrib=-name Description

In this example, the attribute Description of the part is displayed in the bill of materials.

attrib=-name Qta –dval 1

In this example, the attribute Qta is displayed in the bill of materials; -dval indicates that if one part has the empty attribute Qta it is considered as a default value 1.

Within the file, after defining the bill of materials, we find a luafilters section containing the filters applicable to different types of bill of materials:

[luafilters]
         Tutte_le_parti=BomFilter_AllParts Parti_Corrente=BomFilter_PrtCorr
         Parti_Commerciali=BomFilter_IsCommerc
         Parti_Non_Commerciali=BomFilter_NotIsCommerc
         Parti_Pallinate=BomFilter_PrtPall

Each filter definition is represented by a LUA function that deals with the material implementation. These functions are defined in the next section called luacode.

[luacode] lua=local
         PrtIsCommerc = function(prt) return (prt:getAttr(".COMMERC") or "")
         == "1" end lua= lua=function BomFilter_AllParts(prt) return 1 end
         lua= lua=function BomFilter_IsCommerc(prt) return %PrtIsCommerc(prt)
         end lua= lua=function BomFilter_NotIsCommerc(prt) return not
         %PrtIsCommerc(prt) end lua= lua=function BomFilter_PrtCorr(prt) lua=
         if prt:isChildOf(top_pcur()) or prt==top_pcur() then return 1 end
         lua=end lua= lua=function BomFilter_PrtPall(prt) lua= local res =
         prt:getAttr("POS.") or "" lua= if res~="" then return 1 end lua=end
         lua=

Each function returns to value 1 if the part has to be considered admissible to the parts list of the BOM, otherwise returns to nil. Within the luacode section you can also find the definition of the functions that allow you to edit the parts attributes that are associated with the selected BOM line. The TOPBOM.INI file is modifiable through any text file editing program.