Extracting PDMWorks Enterprise BOM

PDMWorks Enterprise 2008 introduced a new ability to automatically export your BOMs during transitions in your work flow. To date though I had not found any example code of how to extract the information from the XML file once it was created.

Luckily, I caught my buddy Philip Stears deep down in his dark lab writing this little diddy.

'Create the document object ready

Dim document As New XmlDocument()
Try
'Load the document from disk
document.Load("WorldDominationPlan.xml")
' Get hold of the root element in the XML file
Dim rootElement As XmlElement = document.DocumentElement
' Go through each element in it called "Property"
For Each childElement As XmlElement In _
rootElement.GetElementsByTagName("Property")
' Get the name and value attributes
Dim name As String = childElement.GetAttribute("Name")
Dim value As String = childElement.GetAttribute("Value")
'Do something clever with them
TakeOverTheWorld(name, value)
Next
Catch ex As Exception
' Foiled again, try again tomorrow
Foiled(ex)
End Try

He was in process of writing the “TakeOverTheWorld” subroutine, luckily I caught Philip just in time. Engineering Data Specialist Man saves the day again!

  • Share this
Find Your Design Solution in the CATI Store.
Browse Products