SOLIDWORKS Manage provides greater flexibility than we’ve known with just PDM in terms of exporting data. We’ve previously covered exporting record item data, so now we’ll extend that by including BOM data.
When exporting BOM information, we’re limited to a number of fields for the child along with all properties from the parent. Additionally, we are given fields related to the child and its configuration in the BOM, such as quantity and item number.
Configuring the XML export for exporting BOM data starts as described in a previous article and then adds a few extra steps. First, we’ll specify the format for the BOM information itself.
To do this, open the object’s administration dialog and go to the BOM configuration page.
We'll select a BOM format that we’ve already defined to edit and use for export.
On the Other Options tab in the BOM properties dialog, find the Export data templates button.
Export file settings are specific to the BOM configuration. If multiple formats are necessary, more BOM configurations will need to be created to suit.
In the File Body area, we define our structure as we did in the Main Text area of the object’s export template.
This structure does not need to be a full XML structure, as it will be repeated per BOM item inside the main template once fully configured.
I’ve created this example as a sub-item structure for how I want my BOM to look as a multi-tiered output.
Input values work the same as defined in the article for exporting record data to XML; the key difference is the options of fields.
Many of the fields are only able to be pulled from the parent and not the BOM item itself. There are also options for Quantity and Item number, which can only exist in a BOM.
We define these one at a time by clicking the + icon. From here, we specify a keyword.
There are no special requirements for keywords, but the idea is to make them unique enough that they won’t be in the body of the XML structure.
In the image below, we have the description from the record being injected into the output file from the keyword ‘$Qty’.
We added an extra character to ensure that the tag of ‘Quantity’ isn’t getting replaced with the values from the record.
Repeat this process for every variable you’d like to see in the XML output, and include the keyword in the file body text.
Once the BOM export template is configured, it can be added to the object’s export template that we’ve previously defined.
To make the template a BOM template, check the box for Export BOM.
This enables the keyword for the BOM field. This can be specified as something custom if necessary, but is BomKeyword by default.
Add this to the main text as shown above.
This will be replaced repeatedly for each item on the BOM. If we toggle the option to export BOM items in Tree style, then BOM items will come with their sub-components noted as a sub-item level with a #.# item number format.
Using the Output children from all BOM levels option, you get this same effect, but item numbers for sub-items start at one for each new sub-assembly.
Running an export that is configured for BOM data is the same as it is for records. To export, right-click a record and go to Tools > Create XML file for ERP.
A dialog will pop up to select which XML template to use. Clicking Generate will process the export and create the file in your site’s output folder.
I hope you found this article demonstrating exporting BOM Data as XML from SOLIDWORKS Manage helpful. Check out more Manage articles below. Additionally, join the GoEngineer Community to participate in the conversation, create forum posts, and answer questions from other SOLIDWORKS users.
Restoring SOLIDWORKS Manage from Backups
Creating Reports for Records in SOLIDWORKS Manage
SOLIDWORKS Manage: Linking External Data Sources and Importing
About Bryce Hooper
Bryce has been using SOLIDWORKS since 2008 in multiple roles across multiple industries from industrial vacuum to RV frame design. He spent many of those years spent as a PDM administrator, implementing 3 PDM vaults along the way. He earned his CSWP in 2019, followed by his CSWE in 2013. Programming is a passion that has followed Bryce through his various positions, writing custom business applications to improve design processes. In his spare time Bryce is a gamer, a maker, and a brewer.
Get our wide array of technical resources delivered right to your inbox.
Unsubscribe at any time.