Customization of Options for Generating Documentation

You can customize NC documentation options with the business rule DELNCDocumentation_ID .

This page discusses:

General Information

The DELNCDocumentation_ID is located in ..\resources\knowledge\scripts. You can invoke it when customizing the following options for the document created by Generate NC Documentation :

  • The format and XSLT to use.
  • The image used as the company logo.

If you use a custom output:

  • The file path of the external command.
  • The command arguments to start the executable.

Input Objects

Input objects must be of the following types:

Parameter Name Comments
RootObject The manufacturing program or part operation of the NC documentation.
MachineReference PLM reference of the NC machine.
XmlFilePath The file path of the generated xml file

Output Objects

Parameter Name Comments
OutputType Allows you to choose to generate a standard HTML output or a custom output.
  • Lets you choose interactively.

    The value is 0.

  • Generate standard HTML.

    The value is 1.

  • Generate output using external post processing.

    The value is 2.

FormatingXSLT Specifies the XSLT formatting that is used: the file path or the title of a document in the database.

If empty, you can choose XSLT from the startup\manufacturing\documentation folder.

CustomCmdPath Full path of the executable to start after the output has been generated in custom output mode.
CustomCmdArgs Any arguments required to start the executable in custom output mode.
CustomOutputFilePath The file path of the generated document in custom output mode.
LogoImage The internet address or file path of the image used as the company logo.
LogoImage2 The internet address or file path of the second image used as the company logo.

Example of Usage

/* DELNCDocumentation_ID
* BL script to generate NC documentation in PDF format
*/

// Uncomment these lines to force user to generate documentation in PDF format
let iOutputType(Integer)
//iOutputType = 2
//Parameters.SetAttributeInteger("OutputType",  iOutputType)

// Option to specifiy logo image to use in the NC documentation
// Can be a internet address or a file path
Parameters.SetAttributeString("LogoImage", "https://www.3ds.com/templates/images/_logo/logo_3DS_dassault.png")

// fop.bat file path
let sExternalCmdPath(String)
sExternalCmdPath = GetEnvVariableValue("NC_FOP_EXE")
Parameters.SetAttributeString("CustomCmdPath", sExternalCmdPath)

// PDF File Path (here we use name of selected program or part operation)
let sXmlFilePath(String)
sXmlFilePath = Parameters.GetAttributeString("XmlFilePath")
let sPdfFileName(String)
sPdfFileName = ThisObject.Name + ".pdf"
let sCustomOutputFilePath(String)
sCustomOutputFilePath = ReplaceSubText(sXmlFilePath,"data.xml",sPdfFileName)
Parameters.SetAttributeString("CustomOutputFilePath", sCustomOutputFilePath)

// Arguments to launch executable
let sXSLTFilePath(String)
sXSLTFilePath = GetEnvVariableValue("NC_FOP_XSL")
let sExternalCmdArgs(String)
sExternalCmdArgs = " -xml " + "\"" + sXmlFilePath +"\""
sExternalCmdArgs = sExternalCmdArgs + " -xsl " + "\"" + sXSLTFilePath +"\""
sExternalCmdArgs = sExternalCmdArgs + " -pdf " + "\"" + sCustomOutputFilePath +"\""
Parameters.SetAttributeString("CustomCmdArgs", sExternalCmdArgs)