Cancel
Showing results for 
Search instead for 
Did you mean: 

Can Export a BOM or a Part list from Teamcenter to Excel by Macro

Experimenter
Experimenter

Hi Guys,

 

I am using TeamCenter 11.0 where I need to download / Export BOM's or Part lists by Macro,

currently I am using Tools->Export->Objects to Excel but it's difficult for a multiple assy. 

 

How can I export them to excel by Macro?

or Is there any possible to connect the TC database to get the BoM by odbc/ query ?

 

Thank you,

Martin

4 REPLIES

Re: Can Export a BOM or a Part list from Teamcenter to Excel by Macro

Phenom
Phenom

You could acheive this with a report.

You may have to modify/create a transfermode with a closure rule and property set to get all the revisions/occurrences and required properties.

 

Then, once you have your xml, you could a apply an xsl stylesheet to save it into excel format.

 

The report uses the transfermode and xsl to generate the excel output file.

 

Richard

www.prospectplm.co.uk

Richard Bennett
PLM Consultant
www.ProspectPLM.co.uk

Re: Can Export a BOM or a Part list from Teamcenter to Excel by Macro

Solution Partner Valued Contributor Solution Partner Valued Contributor
Solution Partner Valued Contributor
Hey, You can try to use BOM Views to accomplish this task. Using PLM/XML export is good solution but it is harder to manage when you add/remove attributes.

Re: Can Export a BOM or a Part list from Teamcenter to Excel by Macro

Experimenter
Experimenter

Can I able to pull the BoM through excel VBA(by PLM/ XML)   without manual Export in TC?

Re: Can Export a BOM or a Part list from Teamcenter to Excel by Macro

Solution Partner Honored Contributor Solution Partner Honored Contributor
Solution Partner Honored Contributor

Maybe you would be interested in command line reporting? It matches your "no button" requirement but needs to be run by an admin with server access and not by individual users.

 

Here is an example of the process for "Logged In Before"...

Create an input file with the argument values for the "Logged In Before" report.

<CrfReport>
  <SummaryReport command="execute" id="TC_2009_00_SUM_RPT_0001"
	 stylesheet_name="users_login_info_html.xsl">
    <report_parameter name="Logged In Before" value="1-Apr-2017"/>
    <report_option name="report_locale" value="en_US" /> 
  </SummaryReport>
</CrfReport>

Run the utility in a Tc command window.

 

import_export_reports -execute -u=infodba -p=infodba -g=dba -f=C:\Temp\report_input.xml

A report will be generated in the path defined by TC_TMP_DIR. If unset the file will be written to C:\. The above example wrote file crf_rpt_4904_0_20042017_1131.html which contained the UserId, UserName and Last Login Time.

 


Randy Ellsworth, Teamcenter Architect, Applied CAx, LLC
NX 11 | SW 2016 | Creo 4 | TcUA 11.4
Evaluating: AW 3.4