Welcome to 3DCADForums

Join our CAD community forums where over 25,000 users interact to solve day to day problems and share ideas. We encourage you to visit, invite you to participate and look forward to your input and opinions. Acrobat 3D, AutoCAD, Catia, Inventor, IronCAD, Creo, Pro/ENGINEER, Solid Edge, SolidWorks, and others.

Register Log in

Get BOM Information

SWL

Newbie
I'm writing a VB .NET application that will extract BOM informations.

Here an example of the BOM of the .dft file:

Item No/"Product No"/"Description"/Qty
------------------------------------------------------
1/"HC026"/"Nylon lock nut 5/16"/4
2/"HDRO-2629"/"Bloc nytralon HDR"/1



I'm only able to get the product number. I also need to get the item number, the description and the qty. Here is my code :

Private seApp As SolidEdgeFramework.Application = Nothing
Private seActiveDoc As SolidEdgeFramework.SolidEdgeDocument = Nothing
Private seDraft As SolidEdgeDraft.DraftDocument = Nothing
Private sePropSets As SolidEdgeFileProperties.PropertySets = Nothing
Dim seDraftSheet As SolidEdgeDraft.Sheet = Nothing
Dim sePartsList As SolidEdgeDraft.PartsList = Nothing
Dim seModelNode As SolidEdgeDraft.ModelNode = Nothing
Dim sePropSet As SolidEdgeFileProperties.Properties = Nothing
Dim I As Integer

seApp = Marshal.GetActiveObject("SolidEdge.Application")
sePropSets = CreateObject("SolidEdge.FileProperties")
seActiveDoc = seApp.ActiveDocument
seDraft = seActiveDoc

seDraftSheet = seDraft.ActiveSheet

For I = 1 To seDraftSheet.DrawingObjects.Count
If TypeOf seDraftSheet.DrawingObjects.Item(I) Is SolidEdgeDraft.PartsList Then
sePartsList = seDraftSheet.DrawingObjects.Item(I)

Exit For
End If
Next

If Not sePartsList Is Nothing Then
For I = 1 To sePartsList.ModelLink.ModelNodes.Count
seModelNode = sePartsList.ModelLink.ModelNodes.Item(I)

If seModelNode.IncludeInPartsList Then 'And seModelNode.IsBallooned Then
sePropSets.Open(seModelNode.FileName, True)
sePropSet = sePropSets.Item("ProjectInformation")

MsgBox(Trim(sePropSet.Item("Document Number").Value))
sePropSets.Close()
End If
Next
End If

For the quantity, I can count it manually with the number of time that I get the same product in the loop.

How can I have the Item number and description? Is there a way to code something else that will give me all the information of the BOM (Item No, Product No, Description and Qty) ?
Thanks a lot!
 

Sponsor

Top