Cancel
Showing results for 
Search instead for 
Did you mean: 

NX 9 Shop Docs Template Customization Tutorial

Siemens Experimenter Siemens Experimenter
Siemens Experimenter

Overview

Documenting the manufacturing plan and the specifics of the NC program are important pieces of the part manufacturing process. This Tech Tip describes the steps to generate shop documentation, then to customize templates to tune the shop docs to your needs.

 

Image5.gif

 

Details

To do this tutorial, you need to save the following files and folders locally:

  • Shop_doc folder containing templates
  • Folder containing part files with operations
  • Empty folder for shop doc output

Image8.gif

 

Copy the folders to your desktop

1. Unzip the attached Templates and Part files.7z file and copy the attached shop_doc folder onto your desktop. This is the same folder as the one in your \MACH\resource\ directory:

 

Example: C:\Program Files\Siemens\NX 9.0\MACH\resource\shop_doc

 

A local copy will allow you to edit and save your own templates.

 

2. Copy the attached Die and Shop Doc output folders to your desktop.

The Die folder contains the part files you will use and the Shop Doc output folder is an empty folder in which you will save the output.

 

3. Add an Environment Variable that tells Shop Docs where to find the templates:

  • Start-->Control Pane-->System and Security-->system-->Advanced System Settings-->Advanced (tab)-->Environment Variables-->New

  • Fill in the following Variable name and Variable value:

Image9.gif

 

  • Click OK twice.

     

    4. Restart NX if it is currently running so the new environment variable will be applied.

Be sure Shop Docs can find where Excel is installed

The shopdoc_excel.tcl file inside the excel_templates folder specifies where Shop Docs will look for the excel.exe file. Example:

set execute_file {C:\\apps\\MSOffice\\Office14\\excel.exe}

 

If you have Excel installed, be sure this path is correct. If Shop Docs does not find Excel (or if you don’t have it), then the output will be displayed by the HTML browser only.

 

Output Shop Docs

  1. In NX, open housing_cover_setup.prt in the Die folder.
  2. In the Program Order View of the Operation Navigator, select 1234.
  3. Click the Shop Documentation icon in the toolbar.
  4. Select Operation List Select (HTML/Excel) in the Report Format list.
  5. Click the Browse for an Output File folder and browse to the Shop Doc outputfolder on your desktop.
  6. Click OK.
  7. Click OK in the Shop Documentation dialog to begin processing.
  8. Click Yes in the Microsoft Office Excel dialog.

Two output files have been created: and html file and an html file displayed in Excel.

 

9. Close the html file so that only the Excel output is displayed.

Notice that the title block has been populated with data and a part image. The operation table has cycled for each operation in the selected program.

 

Note: Other platforms (MacOS, Linux) will not display the output automatically.

Click one of the images in the Path Image column.

 

10. The image is enlarged and displayed in your default graphic viewer.

 

Close the image and the Excel output window.

 

Note: You must close all output windows before generating the next output or you will receive an error.

Repeat the above steps to output a single operation or a group in the Machining Method View. Also, try using other templates in the Report Format list.

 

Editing an Existing Template

 First, you will make a simple text edit to the template and then generate the output to see the edit. Then, you will edit a MOM variable and change the page formatting.

 

  1. On your desktop, open the /shop_doc/excel_templates/ folder.

  2. Double-click to open shopdoc_template_English_operation_list_select.xlsx

  3. In the Excel file, change Program Sheet in the title to Die.

  4. Do not save the change.

Update the template

5. In Excel, File-->Save As-->Save as type: Web Page (*.htm;*.html)-->Republish: Sheet.

 

Image10.gif

Note: Shop Docs supports Excel 2007 and later. The above illustration shows Excel 2010.  Other versions of Excel may vary slightly.

 

6. Check to be sure you are saving in your local copy of the /shop_doc/excel_templates/ directory on your desktop.

7. Select Save.

8. In the Publish as Web Page dialog box, select Publish.

9. Leave the edited shopdoc_template_English_operation_list_select.xlsx file open for now.

 

Generate output using the updated template

10. In NX, Select 1234àShop DocumentationàOperation List Select (HTML/Excel)àOK

Notice the output reflects the change you made (Program Sheet to Die) to the Excel file.

 

11. Close the output windows.

 

Edit the Excel file

Next, you will edit a MOM variable. Sheet 2 in the Excel file contains many MOM variables with descriptions that are available to customize the template. Filtering by Class, Sorting alphabetically, and Finding key words are useful in navigating this list.

 

12. Click the mom_vars tab at the bottom of the shopdoc_template_English_operation_list_select.xlsx file.

13. Pick Class at the top of column B and select Filter  Image11.gif  in the toolbar.

14. At the top of column B, pick the Image12.gif  button next to Class and uncheck  Image13.gif Select All.

15. Scroll down and check Image14.gif Tool.

16. Click OK.

17. Pick the “A” at the top of column A and select Find Image15.gif in the toolbar.

18. Type Dia in the Find what field and click Find All.

19. In the Find and Replace window, pick mom_tool_diameter in the Value column.

20. Type Dia in the Find what field and click Find All.

21. In the Find and Replace window, pick mom_tool_diameter in the Value column.

 

Image16.gif

 

22. Close the Find and Replace window.

23. Click the shopdoc_template_English tab at the bottom of the Excel file.

24. Paste mom_tool_diameter in place of mom_oper_tool (be sure to retain the brackets).

 

Image17.gif

  

25. Change Tool Name in the column heading to Tool Dia.

26. Change### REPEAT TITLE### to Yes.

 

Image18.gif

 

 REPEAT TITLE allows you to repeat the title block (defined between ###BODY START### and the ###TABLE START### markers) on each page.

 

27. Do not save changes.

 

Generate output using the updated template

28. In NX, Select 1234àShop DocumentationàOperation List Select (HTML/Excel)àOK

Notice the title block is repeated on page one and two and that the Tool Dia column now reflects the diameter of each tool.

29. Close the output window.

Here is an overview of the types of edits you can make to the template:

 

Image5.gif

 

Creating a New Template

Here’s what you will do:

  • Save the edited Excel file under a new name
  • Create a new template
  • Create a new .tcl file. This determines which template to process when you select an option in the UI
  • Edit the .dat file to determine what you see in the user interface and which .tcl file to use
  • Generate output using the new template

Save a new .xlsx file

Begin by saving the .xlsx file you edited under a new name.

 

1. File-->Save As--> File name:  my_template.xlsx-->Save             

 

Create a new .htm file

Now, create a new template with the same content as the .xlsx file.

 

2. File-->Save As-->Save as type: Web Page (*.htm;*.html)-->Republish: Sheet -->Save-->Publish

Look in the excel_templates folder (your local copy) and notice that you have created two files and the system has created a folder to support the .htm file:

 

Image19.gif

 

Create a new .tcl file

The .tcl file for the new template must have the same name as the .htm file so that the system knows which .htm file to process. This common file name “connects” the .tcl and .htm files.

 

3. In the excel_templates folder, Copy and Paste shopdoc_template_English_operation_list_select.tcl  

4. Rename it my_template.tcl

5. You should have three files:

 

Image20.gif

  

.xlsx: The Excel file containing your edits on sheet 1 and all available mom variables on sheet 2. This is your working file.
.htm: The template the system uses to create the shop doc output.
.tcl: The .tcl file that determines which .htm file to process when you select an option in the UI.

 

Edit the.dat file

shop_doc.dat file determines what you see in the Shop Doc user interface and specifies which .tcl file to use.

 

6. Go back one level in the directory.

7. Find shop_doc.dat and remove RO if necessary.

8. Open shop_doc.dat in a text editor.

Each line corresponds to an existing template. “#” are templates that are commented out and do not appear in the NX user interface. You can copy and edit any line.

 

9.Copy all the text from line 1:

 

Operation List Select (HTML/Excel), ${UGII_CAM_SHOP_DOC_DIR}excel_templates\shopdoc_template_English_operation_list_select.tcl, ${UGII_CAM_SHOP_DOC_DIR}excel_templates\shopdoc_excel.tpl

 

10. Paste as a new line at the bottom of the list.

11. Key in what you wish to appear in the UI  - My Operation List Select (HTML/Excel)

12. Key in the name of the .tcl file you just created  - my_template.tcl. This “connects” the .tcl file to the UI selection.

 

My Operation List Select (HTML/Excel), ${UGII_CAM_SHOP_DOC_DIR}excel_templates\my_template.tcl, ${UGII_CAM_SHOP_DOC_DIR}excel_templates\shopdoc_excel.tpl

 

13. Save and Close shop_doc.dat

14. Create Shop Doc output using the new template:

 

Image21.gif

 

Do you have a question?

Post your questions or comments at the bottom of this Tech Tip. (You must be signed in to access this feature.)

 

About the Author

Holder.jpg Bill Storrs is in the CAM Product Management Group at Siemens PLM software, Cypress California. His main focus is on CAM usability and learning support. He currently leads the CAM Learning Initiative Team whose mission is to provide users with a comprehensive collection of reference and training materials. He has an M.A. in Corporate Training and Development and has been in the industry for over 20 years.

 

Comments
Solution Partner Enthusiast Solution Partner Enthusiast
Solution Partner Enthusiast

Good!

Creator
Creator

I'm Having trouble succeeding through this guide.

At the point of Publishing the .htm.

Even with no edits to the .xlsx, just open and publish the .htm causes NX to throw .tcl errors when using the new template.

 

I've tried on Excel 07, and '13

 

Comparing the 2 .htm, the OOTB, and the unaltered, but republished one.

I see only minor differences. "I think just the sizes of the boxes or fonts by a couple points".

Dreamer
Dreamer

HI ,

 

I am trying to customize Shop doc . But I have encounter problem when I want a total machining time in Shop Doc. The command I am using is ${mom_machine_time}. But It could not create total machining time. Is there additional comand i need to input .Thank You.

 

SDMK

Pioneer
Pioneer

I am trying to move my new shopdoc to the actual directory inside the NX program file directory but get an error, is this somehow linked to the modified environmental variable?  Does it need to be reset/removed?

 

The error says "Postprocessor and ISV files were not found in Teamcenter"

VIP
VIP

For a question like this, I would contact GTAC, or ask in the NX Manufacturing Discussion Forum.

 

Siemens Theorist Siemens Theorist
Siemens Theorist

Bill, I'm not seeing the edits I make after publishing the file as you describe. This is step 9 & 10 of editting an existing template. I don't get any errors. I'm using Excel 2010.

Esteemed Contributor
Esteemed Contributor

The folder might get localized, so it is called my_template_dateien in German, for example.

So you need to rename the folder to my_template_files to make the changes take effect.

Pioneer
Pioneer

I went thru the instructions and had success when I copied the operation list template. When I copy the tool list select template I get a TCL error no matter what options I choose when saving the HTML. Then when I just tried to save the original template html for the tool list it is no longer working.

 

Running 9.0.3.4 MP8

Windows 10

Esteemed Contributor
Esteemed Contributor

It is not possible to use formulas, the Excel based shop documentation only supports plain variables.

If you need calculation, you have to use the old shop documentation templates.

Esteemed Contributor
Esteemed Contributor

I suggest to start a new thread on the manufacturing forum, since blog posts are not suited well for discussion about specific problems.

In addition only a few people are reading the blogs usually.

Theorist
Theorist

Hello Roeder,

 

The value you are getting (0.06992681194) is actually the correct value. NX lists the values in Radians. To convert from Radians to Degrees, the conversion is Radians x ( 360 / (2 * Pi)). To be clear, that is 360, divided by 2 times Pi. A rough calculation of 360 / 6.2831 = 57.29577957855.

 

Multiply that number (57.2957795) by your Radian value (0.06992681194):

 

57.2957795 x .06992681194 = 4.006511203 degrees...

 

 

LIVE Tech Tip Webinars
Watch NX experts demonstrate manufacturing best practices. Stay online for Q&A.