Cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

Pull info from an external file (.txt or .xls) into program output

PLM World Member Creator PLM World Member Creator
PLM World Member Creator

I am pretty sure this is possible, and I am sure this is covered somewhere, I am just not sure how to "key" word my search.

 

I am looking to be able to have a text or excel file that has employee information (ie. Employee Name and ID Number) in it, that the Post Processor will refer to, to swap the ID Number for the Employee Name.

 

We have multiple Post Processors, and I would like to be able to modify one file, with the Name and ID info, instead of editing each PP.

 

The Employee ID Number will be coming from the CPU Login ($mom_logname), and will reference the "table" for the Employee Name.

 

TIA!!!

 

Douglas Sagan
CNC Programmer
GE Transportation
Grove City, PA, USA
________________________________________
NX: 10.0.3.5 MP19
PB: 10.0.3.0
CPU: HP Z440 - Intel Xeon - CPU E5-1650 v4 @ 3.60GHz (6 Core/12 Processor)
OS: Win10 Pro x64 (B: 15063)
RAM: 32 Gb
GC: Nvidia Quadro K2200
3 REPLIES

Re: Pull info from an external file (.txt or .xls) into program output

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

Yes, it is possible. It will be the easiest with txt file. Here you have doc about tcl commands which you will use: http://wiki.tcl.tk/367

You will use:

open

read

close

and split, to get the result as list of strings instead one large string (if you will need it)

Marek Pawlus, NCmatic

Development: C#, Tcl/Tk, CSE

Re: Pull info from an external file (.txt or .xls) into program output

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

To do this code once, you will need to "source" in a common tcl file

In Post Builder:

"Output settings" tab

"Other options" tab

"user tcl source" block

 

My recommendation would be to

- use a specific "user" tcl for each post (e.g. if post name is "ABC123_mill_3x", set the user file to "ABC123_mill_3x_user")

- in that _specific_ file, use the tcl "source" command to source in the _common_ tcl code (one file shared by all posts)

- After adding the custom command (to call the common tcl proc) in one post, export it, then you can import in all your other posts.

 

Hope this helps...Ken

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP16/TC11.2
I'd rather be e-steamed than e-diseaseled


Re: Pull info from an external file (.txt or .xls) into program output

PLM World Member Creator PLM World Member Creator
PLM World Member Creator
Thank you for your suggestions! I will research these methods, and post my findings. Just to clarify what I am looking to accomplish: The purpose of this separate "table/list" is to make it easy for someone that is not a PostBuilder user, to be able to add/delete/edit employee info in this listing, without having to actually edit the Post(s). I am trying to make it "Dummy Proof", or as close as it can be.
Douglas Sagan
CNC Programmer
GE Transportation
Grove City, PA, USA
________________________________________
NX: 10.0.3.5 MP19
PB: 10.0.3.0
CPU: HP Z440 - Intel Xeon - CPU E5-1650 v4 @ 3.60GHz (6 Core/12 Processor)
OS: Win10 Pro x64 (B: 15063)
RAM: 32 Gb
GC: Nvidia Quadro K2200
Highlighted

Pull info from an external file (.txt or .xls) into program output

PLM World Member Creator PLM World Member Creator
PLM World Member Creator

I am pretty sure this is possible, and I am sure this is covered somewhere, I am just not sure how to "key" word my search.

 

I am looking to be able to have a text or excel file that has employee information (ie. Employee Name and ID Number) in it, that the Post Processor will refer to, to swap the ID Number for the Employee Name.

 

We have multiple Post Processors, and I would like to be able to modify one file, with the Name and ID info, instead of editing each PP.

 

The Employee ID Number will be coming from the CPU Login ($mom_logname), and will reference the "table" for the Employee Name.

 

TIA!!!

 

Douglas Sagan
CNC Programmer
GE Transportation
Grove City, PA, USA
________________________________________
NX: 10.0.3.5 MP19
PB: 10.0.3.0
CPU: HP Z440 - Intel Xeon - CPU E5-1650 v4 @ 3.60GHz (6 Core/12 Processor)
OS: Win10 Pro x64 (B: 15063)
RAM: 32 Gb
GC: Nvidia Quadro K2200
NX CAM Postprocessor Group
NX CAM Postprocessor Group

Members (148)