I am in the process of trying to find the simplist way to extract BOMs from a draft. I am an IS specialist at my company and we have an upload tool to get new parts and BOMs into our ERP system as long as it's formatted correctly. I just need a quick way to extract the table data so then I can format it as neccessary to interact with the upload tool.
These are not your standard BOMs that you would normally use in solidedge, instead they are manually typed parts lists that span multiple pages. I am aware that I can go to Properties>Data and highlight the fields and copy+paste into excel. This is really cumbersom when the BOM spans 20 pages so there are 20 individual tables, and there is potential of missing a page. What I am thinking is a macro that can find and save into an array, all tables of a certain type. From there its simple vb to get the data as I need it. I just am not sure how to go about doing that, I am having some issues finding resources on the subject. Do you have any thoughts?
My backup plan for this works but idealy I would like to use the macro. I have successly been able to 'print' the BOM pages to PDF, convert to excel, and used a VB macro to get the csv file I need. But obviously a 1 click action an solidedge would be more ideal.
Any help is appreciated!
Probably better posting this on the Developer Forum.
At the top of the page there is a link to Useful Solid Edge Developer Community links.
If you understand VB etc you shouldn't have too much difficulty finding and modifying code (much of it by the genious Jason Newell). I know there is something in there about exporting Parts Lists - you will need to adapt it for 'Tables'
That sounds logical to me but I can't seem to get the syntax right. From what you are saying I want to loop through each table in the document. Then display the name(for testing purposes)
Dim draftDocument = application.GetActiveDocument(Of SolidEdgeDraft.DraftDocument)()
For Each n in draftDocument.Tables
console.write('''''How do I get the name of each table?)
draftDocument.Tables.count does = 86 so I can grab the number of tables but I just cant seem to figure out how to grab the table title of each
every table has objTable.Titels.Count giving the number of titles for that table
The objTable.Titels.Item(1).Value brings You the first title text.
Normally I look for the first title.
If a table has more than one title it might be not so important.
I always use the first one for comparison reasons.
You can compare this text with Your search text and if it matches then YOu will use it
Hope this helps
I would suggest downloading Spy for Solid Edge - you can find it on the page I linked to.
That will be a great help when looking for the way objects etc are organised.
It will show you everything about any open SE document.
Also the .Net Programmers guide is a great starting point for programming -
Thanks for getting me on the right track. After a lot of roadblocks mostly with how to syntax what I needed to do I was able to loop through all the tables and print the titles. From here I will keep building to get what what I need from it
Code for future googlers:
Dim oApp As SolidEdgeFramework.Application
Dim oDoc As SolidEdgeDraft.DraftDocument
Dim otab As SolidEdgeDraft.TableTitles
Dim otab1 As SolidEdgeDraft.TableTitle
Dim otab2 As SolidEdgeDraft.Tables
Dim otab3 As SolidEdgeDraft.Table
oApp = Marshal.GetActiveObject("SolidEdge.Application")
oDoc = oApp.ActiveDocument
otab2 = oDoc.Tables
Dim icount As Integer = 1
For Each otab3 In otab2
otab = otab3.Titles
For Each otab1 In otab
icount = icount + 1