Reply
Solved! Go to solution

BoM reports and automation

Hello Solid Edge Community. 

 

I know SE has a function to call a BoM report for an assembly file. I'm hoping to automate this process a bit through VB code. 

 

I know there is suppose to be a macro in the SE custom folder but I seem to be missing it for some reason. If someone could point me in the direction for redownloading it, that would be a start. 

 

The end goal is to have an excel macro automatically grab a report from an ASM file and paste it onto a sheet for data manipulation down the road. 

 

I have some starting code that looks as follows: 

 

Sub GetFileReport()


Dim objApp As Object
Dim objDoc As AssemblyDocument

Dim uploadfile As Variant

'Connect to a running instance of Solid Edge.
Set objApp = GetObject(, "SolidEdge.Application")
If Err Then
'Clear the error.
Err.Clear
'Start Solid Edge.
Set objApp = CreateObject("SolidEdge.Application")
End If

MsgBox "Select Assembly File"
uploadfile = Application.GetOpenFilename()

Call objApp.Documents.Open(uploadfile)
objApp.Visible = True

If objApp.ActiveEnvironment <> "Assembly" Then
MsgBox "This program must be run in the Assembly environment."
Else
Set objDoc = objApp.ActiveDocument

' Here

 

' Here
End If

Set objApp = Nothing
Set objDoc = Nothing

End Sub

 

I'm looking for the code to put "Here" that will create a report. I can worry about copy and pasting it after the fact. That I know. But I've scoured the SE libraries looking for something that would call a report to no avail. Maybe this is in the custom macro and everything will make sense when I download that. 

 

Thanks in advance, 

 

Derek

4 REPLIES

Re: BoM reports and automation

I would not recommend going that rout. I use the built in Parts lists where I never fill out a single piece of information. Everything is embedded into the parts.

 

As you make changes to an assembly, excel will not auto update. You will have to delete and re-add for every small change. The built in parts lists will auto update for every small change in the assembly & parts.

 

 

Re: BoM reports and automation

This may be easier than that.  In the Solid Edge "Program" folder there is an application called "Report.exe" that can be called via command line to export the BOM.  For instructions, look up the topic "Command Line Arguments for Report.exe" in the Solid Edge STn SDK help file.


Thanks,
Ken

Production: ST9 MP7
Testing: ST10

Re: BoM reports and automation

This sounds very useful. Where or what is an STn SDK file? 

 

The reason I want to create reports in excel isn't for live reporting. It is for pinpoint comparasins between old and new assemblies, specifically when creating specials from old stock. The working reports list in SE doesn't fit that need effeciently. Having to create the SE report, then copy to clipboard, then paste into excel is tedious and automatable. 

 

I use this data to run a simple Excel macro and highlights the differeneces in quantity and part names. Right now my company does all this by hand and writes the differences on to a paper bill of material so even if you don't agree with this solution, it is still miles ahead of our current standard. 

 

Thank you for the replies. It is clear this is a strong and healthy community. 

 

Derek Gooding

Solution
Solution
Accepted by topic author DerekGoo
‎06-13-2017 12:49 PM

Re: BoM reports and automation

"STn"  is "ST9" if using ST9.  The SDK Help file (sesdk.chm) can be found either in "C:\Program Files\Solid Edge ST9\SDK" or by using the Help pane and clicking the link "Programming with Solid Edge".


Thanks,
Ken

Production: ST9 MP7
Testing: ST10