How to Customize NC Documentation (VSTA Macro)

Introduction

This document is intended to provide detail guide on how to modify the VSTA Macro Project code to generate custom NC Documentation output. Also there is custom "MacroDocWizard" VSTA Macro Project provided at the end for reference. It can generate multiple custom file outputs.

Version – Applicable on and before 2025x FD04 (FP)

Pre-requisites: User must be assigned with Leader Role

Licenses –

  • CSV (Collaborative Industry Innovator)

  • NSR (NC Shop Floor Programmer) or any other machining programming Role
Disclaimer: Licenses mentioned above are as per 2025x documentation.

What is VSTA Macro?

VSTA (Visual Studio Tools for Applications) macros are a feature within the 3DExperience Platform that allows users to automate repetitive tasks and extend the functionality of the platform. These macros are written in C# or VB.Net and can be used to perform a wide range of actions, such as data manipulation, report generation, and user interface customization.
 

      

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

VSTA Project layout

When you open a VSTA macro in Visual Studio, the workspace is similar to a standard C# project, but contains special components.

Solution Explorer

Resources folder structure

Primary example for the files that are uploaded in this folder are the XSLT files for different output file formats and the External Post Processor (Apache FOP converter) setup folder and batch file etc.

VSTA Macro Workflow

1. Generate Data.xml

2. Apply xslt

An XSLT file (Extensible Stylesheet Language Transformations) is a transformation program that converts an XML document into another format—such as HTML, PDF (via XSL-FO), text, Excel, or another XML.
In this project we have XSLT files for HTML, PDF and WORD format.

3. Run Post Processor

  • HTML File Format
    • For HTML generation there is method available in C# language to transform the data.xml into the html output file with the help of XSLT for the format

  • PDF File Format
    • For PDF generation, Apache FOP converter is embedded in the project and triggered at the final stage

 

 

 

 

 

 

 

 

4. Save output

  • After the Output file is generated, all the generated data is stored in the NC files container for saving it in the platform

 

 

 

 

 

 

 

 

  • All the generated data is also stored in the local folder at below location
    • C:\\Users\\YOURTRIAGRAM\\AppData\\Local\\Temp\\TempFolderName

Adding new file format in VSTA Macro

Target File Format: The custom NC Document that we want to generate out of VSTA Macro.

Steps for new file format addition

Final Achieved Result

How to Update the VSTA Macro

  • How to add logo image

  • How to add resource(XSLT file for target format)

  • How to edit finish form code

  • How to add user input in user interface

  • How to configure the user inputs required based on file type selected

  • How to make the user input values persistent

  • How to edit XMLData.cs

     

Presentation Document

Reference Data

While exploring the VSTA Macro and how to modify it we have developed few custom file output formats. Follow the provided steps to deploy the provided custom macro project that can generate all these custom file outputs.

  1. Download the 3DXML file below

    MacroDocWizard_Custom.3dxml
  2. Import the file in 3DExperience Platform using "3dxml with Authoring" mode.

  3. Open the Machining Program data for which you want to generate the Technical Documentation

  4. Launch Macros command from Tool Section

  5. Add the imported PLM VSTA Project in Macros library and run "MacroDocWizard" macro

     

Below is the list of all the available custom file output formats, corresponding XSLT file name and sample output file.

Sr.No.Output Format NameXSLT File NameSample Output File
1General html (OOTB Output)
doc.xslt
doc.html
2General html (OOTB Output)
menu.xslt
menu.html
3General html (OOTB Output)
index.xslt
index.html
4General pdf
General_pdf.xslt
doc.pdf
5Simple pdf
Simple_pdf.xslt
doc_Simple.pdf
6Simple docx
Simple_docx.xslt
Report.docx
7Intermediate pdf
Intermediate_pdf.xslt
doc_Intermediate.pdf
8Complete pdf
Complete_pdf.xslt
doc_Complete.pdf

Author

Person of Contact - @Sheetal MARDE 

Special Thanks to @Nicolas SPISS and @Christophe DECIS for providing support in this topic.

 

Feel free to reach out to me if you have any questions or need more details.