Running the CATPDMExtractEV5Batch Batch Process

The extraction of data from the VPDM can be automated by running the CATPDMExtractEV5Batch batch process. This batch is driven via a command line giving as input the root of the assembly on which the extraction will be done.
  1. To retrieve the help information:

    CATPDMExtractEV5Batch -help

  2. To run the extraction:

    CATPDMExtractEV5Batch [-prc RootPRCName] [-adddoc DocName.DocType] [-adddoc DocName.revision.DocType] [-completeWithDrawing] [-completeWithAnalysis] [ -completeWithImpactedBy level number|all_level] [ -completeWithDesign]
    [-configHandler ConfigHandlerName]
    [-zoneFilter ZoneName] [-zoneClearance ClearanceValue] [-zoneMode FullyIn|FullyOut|PartlyIn|PartlyOut] [-pvs PVSName]
    [-attributeFilter AttributeName Operator Value]
    [-separator string] [-namingRules XMLNamingRulesPath] [-noDraftingUpdate]
    -out outputpath [-delete] [-srmload false] [-epexml outputXmlFile] [-report xmlReportFile]
    [-server xxx] [-role xxx] [-user xxx] [-pwd xxx] [-spwd xxx]

Arguments

Connection Information

-server xxx : Server name.
-role xxx : Role used for ENOVIA V5 VPM connection.
-user xxx : User for ENOVIA V5 VPM connection.
-pwd xxx : User password for database connection.
-spwd xxx : Secure password for database connection.

General Information

-help Help
-prc prcname : Name of the PRC to extract.
-adddoc docname : Enables to add to the session documents that are not attached to the assembly expanded from the PRC. Can be also used to extract standalone documents. Several adddoc statements are possible.
-completeWithDrawing: Automatically extracts the CATDrawing documents that are relying on all design data (i.e. CATProduct, CATPart and model) loaded in the current session.
-completeWithAnalysis: Automatically extracts the CATAnalysis documents that are relying on all design data (i.e. CATProduct, CATPart and model) loaded in the current session.
-completeWithImpactedBy [level number | all_level]: Automatically extracts documents that have a ref-ref link to documents loaded in the current session. You may specify the level of links to automatically extract or specify that all levels of links be automatically extracted. If a level is not specified, the level will default to one.
-completeWithDesign: Automatically extracts documents that have a ref-ref link to documents loaded in the current session (equivalent to -completeWithImpactedBy 1).
-configHandler CfgHandlerName: used to specify the ID of a configuration handler (already defined in ENOVIA V5 VPM) to be used to filter the structure to be extracted from ENOVIA V5 VPM. CfgHandlerName is the identifier of the configuration handler. This option may be specified at most one time in one command.
-zoneClearance ClearanceInMillimeters: sets the clearance (in millimeters) to be used in a volume filter on the structure to be extracted from ENOVIA V5 VPM. This option may be specified at most one time in one command.
-zoneMode FilteringMode: sets the volume filter mode to be used in a zone filter on the structure to be extracted from ENOVIA V5 VPM. Values can be FullyIn, FullyOut,PartlyIn and PartlyOut. PartlyIn is the default value. This option may be specified at most one time in one command.
-zoneFilter ZoneName: zoneName is the identifier of a single zone (already defined in ENOVIA V5 VPM) to be used in a zone filter on the structure to be extracted from ENOVIA V5 VPM. This option may be specified more than once in one command.
-pvs PVSName: Defines the Expand Capture (PVS) to be used for product structure filtering. This option is mutually exclusive with options -configHandler, -zoneFilter, and -attributeFilter. Thus, only one of -pvs or the combinations of -configHandler, -zoneFilter, and -attributeFilter is valid.
-attributeFilter AttributeName Operator Value: used to specify the criteria to be used in an attribute filter applied to the ENOVIA V5 VPM product structure to be extracted. attName is the identifier of an attribute of an instance or part reference. attOperator is the operator to be used in the filter predicate. attValue is the attribute value to be used. This option may be specified more than once in one command. attOperator can have the following values: LIKE, EQ (=), NOTLIKE, NOTEQ (!=), GT ( >), GTEQ (>=), LT (<), LTEQ (<=).
-separator string: used to specify a string to be used as a delimiter for the -prc and -adddoc keywords (instead of the default delimiter, ".").
-out outpath : Path of the folder in which the session will be saved.

-delete : Force deletion for files already existing in output folder before extraction.
-srmload :To activate or not the option "SRM extraction" when loading documents. Default value is true.
-epexml : To generate an XML template file that can be used by reconciliation batch.
-report : To generate an XML report listing extracted documents
-namingRules:
Define the XML file in which renaming rules are defined. Those rules use predicates on VPMD attributes of the Part or the document. Rules priority is mapped on rules order inside the XML files(Only the first rule encountered with predicate set to true will be used)
-noDraftingUpdate: Enables to inhibit the update of CATDrawing before save. It is highly recommended not to use this option in case of assembly drawing on top of storage mode set to structure exposed.

Note:

  1. If only -pvs argument is passed: The PRC information read from PVS dynamically and it is expanded with PVS filter criteria.

    If -pvs and -prc argument is passed: The PRC information is not read from PVS, the passed PRC argument will be taken as root and only PVS filter criteria will be used for expanding the root

  2. -prc is optional.

  3. -adddoc is optional, the value expected is the value of the V_ID attribute plus the extension of the document separated by a dot.

  4. More than one ENOVIA V5 VPM document can be added to the session: each document can be added by a -adddoc statement.

  5. Documents are extracted to path given by -out argument. If documents already exist with the same name the extraction will failed.

  6. About traces: the batch will run in background due to infrastructure limitations (see Part3 limitations list). To retrieve the batch traces, you should use environment variable CNEXTOUTPUT.

Declaration of naming rule convention for Extract:

Declaration is done in an XML file that contains a list of Naming Extract Rules. Each rule is made of one condition and one naming operator. If the condition is verified, the naming operator will be used to generate the file name used when saving the file to disk.

Condition is made of a series of Predicates and each predicate is defined by an attribute id, a comparison operator and a value. The attribute can be selected from VPDM attributes or internal attributes of the document, or from the root product of this document for a CATPart or a CATProduct. Internal attributes are standard attributes such as document type, Part or document name or it could be specific to the VPDM system; for instance for ENOVIAVPM, we can access an environment or a table. The attribute of a Root Product of CATPart or CATProduct, has an attribute id that starts with the string “Part.”.

Naming Operator is a series of string elements that will be concatenated to define the name of the file. You do not have to add the file extension it will be automatically done by the program.

<NamingRule>
<ExtractRule id="R1">
<Condition>
<Predicate type=internal id=Type operator== value=CATPart”/>

<Predicate type=internal id=VPM.Environment operator=LIKE value=W*”/>

<Predicate type=VPDM” id=Part.Part Number” operator=LIKE value=P00*”/>
</Condition>

<NamingOperator>

<Element type=internal id=VPM.Environment" length=10 padding=“ ”/>

<Element type=string id=“_" />

<Element type=VPDM” id=Part. Part Number />

<Element type=string id=“_" />

<Element type=VPDM id=Part. Part Version” />

</NamingOperator>
</ExtractRule>
<ExtractRule Name=R2”>
</ExtractRule>
</NamingRule>


Example of XML naming rule file

For ENOVIA VPM V4:NamingRuleForVPM.xml

For ENOVIA V5 VPM: NamingRuleForEV5.xml

List of xml node and attribute of XML naming file

XML Node

Attribute

Description

NamingRule

Root of the XML document

ExtractRule

Define a new Naming rule for EPE extraction utilities. <ExtractRule Name=“R1”>

Id

Rule identifier.

Condition

Define the condition to activate an extraction rule.

Predicate

Define a predicate for a condition.

type

Define the type of attribute to test. Value could be: internal or VPDM.

id

Identifier of the attribute to be tested. If Id is prefixed by Part. The string attribute will be found on the child Part (root product).

operator

Test operator, it could be: = or LIKE.

value

Value to be used for predicate evaluation.

NamingOperator

Element

One element to be used to build a name by concatenation.

type

Defines the type of attribute to test. Value could be:

String Id is the string value to be inserted in the name.

internal Id is the name of an internal attribute to be used.

VPDM Id is the name of a VPDM attribute to be used.

id

Identifier of the attribute to be used. If Id is prefixed by Part. String attribute will be found on child Part (root product).

length

Number of characters to be inserted.

If the string is too small, we will pad with padding characters, if defined. Otherwise length is only considered as a maximal length of the string to be concatenated.

If the string is too large only the length first characters will be used.

padding

Optional: Enables the use of a character string as padding if attribute length is smaller than the value defined in length.

List of internal attributes

Attribute

Description

General internal attributes

Name

Current identifier of the document or the part.

Type

File extension for document or Part.

StorageMode

PUBLICATION_EXPOSED or STRUCTURE_EXPOSED.

Environment

ENOVIA5 or VPM1. Indicates the environment:

ENOVIA V5 VPM or ENOVIAVPM.

Internal attributes for ENOVIAVPM

VPM.Environment

ENOVIAVPM environment.

VPM.Table

ENOVIAVPM table.

Internal attributes for ENOVIA VPM V5:

EV5.Type

Could be PRC, PV or DR.

PRC stands for Product Root Class

PV stands for Part Version
DR stands for Document Revision

Examples

When running batches, you must always:

  • use the command catstart
  • the catstart environment (option -env) to be used is the same as the environment used with VPM Navigator.

For more details, see the Infrastructure Guide, Basic Tasks, Starting a Session on Windows.

set CNEXTOUTPUT=E:\tmp\trace.txt
catstart -run "CATPDMExtractEV5Batch -adddoc RECV5_EXTRACT1_PART1.CATPart -out c:\temp\ "

  1. Extraction of a single Part:

    CATPDMExtractEV5Batch -adddoc RECV5_EXTRACT1_PART1.CATPart -out c:\temp\

  2. Extraction of two CATParts and CATDrawing based these CATParts:

    CATPDMExtractEV5Batch -adddoc RECV5_EXTRACT2_PART1.CATPart -adddoc RECV5_EXTRACT2_PART2.CATPart -adddoc RECV5_EXTRACT2_drawing.CATDrawing -out c:\temp\

  3. Extraction of an assembly:

    CATPDMExtractEV5Batch -prc RECV5_EXTRACT3rootprc -out c:\temp\

  4. Extraction of an assembly drawing with its assembly:

    CATPDMExtractEV5Batch -prc RECV5_EXTRACT4rootprc -adddoc RECV5_EXTRACT4_drawing.CATDrawing -out c:\temp\

    OR

    CATPDMExtractEV5Batch -prc RECV5_EXTRACT4rootprc -completeWithDrawing -out c:\temp\

  5. BlackBox assembly (CATProduct):

    For CATProduct RECV5_EXTRACT4rootproduct.CATProduct containing two CATParts, RECV5_EXTRACT4_PART1.CATPart and RECV5_EXTRACT4_PART2.CATPart:

    CATPDMExtractEV5Batch -adddoc RECV5_EXTRACT4rootproduct.CATProduct -adddoc RECV5_EXTRACT4_PART1.CATPart -adddoc RECV5_EXTRACT4_PART2.CATPart -out c:\temp\

  6. Extraction of a single Part given its revision (--A):

    CATPDMExtractEV5Batch -adddoc RECV5_EXTRACT1_PART1.--A.CATPart -out c:\temp

  7. Extraction of linked CATParts:
    Three CATParts: RECV5_EXTRACT_PART1.CATPart,RECV5_EXTRACT_PART2.CATPart,RECV5_EXTRACT_PART3.CATPart.
    RECV5_EXTRACT_PART3.CATPart is linked (with copy/paste with link) to RECV5_EXTRACT_PART2.CATPart.
    RECV5_EXTRACT_PART2.CATPart is linked (with copy/paste with link) to RECV5_EXTRACT_PART1.CATPart.

    To extract all three CATParts
    CATPDMExtractEV5Batch -adddoc RECV5_EXTRACT_PART1.CATPart -adddoc RECV5_EXTRACT_PART2.CATPart -adddoc RECV5_EXTRACT_PART3.CATPart-out c:\temp

    OR

    CATPDMExtractEV5Batch -adddoc RECV5_EXTRACT_PART3.CATPart -completeWithImpactedBy all_level -out c:\temp\

    Note: to extract only one level (i.e. only RECV5_EXTRACT_PART3.CATPart and RECV5_EXTRACT_PART2.CATPart) -completeWithImpactedBy would replace -completeWithImpactedBy all_level (in this case, it is not necessary to specify the level, since the default is 1).

  8. Extraction of CATPart with Analysis files:
    RECV5_EXTRACT_PART1.CATPart, Analysis1.CATAnalysis, Analysis11.CATAnalysisComputations and Analysis12.CATAnalysisResults

    To extract the CATPart with all it's analysis documents
    CATPDMExtractEV5Batch -adddoc RECV5_EXTRACT_PART1.CATPart -adddoc Analysis1.CATAnalysis -adddoc Analysis11.CATAnalysisComputations -adddoc Analysis12.CATAnalysisResults -out c:\temp
    –role myRole –user myUser –spwd mySpwd\

    OR

    CATPDMExtractEV5Batch -adddoc RECV5_EXTRACT_PART1.CATPart -completeWithAnalysis -out c:\temp
    –role myRole –user myUser –spwd mySpwd\

  9. Extraction when configured data with a filter set is sent to supplier.
    This example will filter the ENOVIA V5 VPM structure with the configuration filter contained in the configuration handler, cfgHdlr1.
    CATPDMExtractEV5Batch -prc RECV5_EXTRACT3rootprc -configHandler cfgHdlr1

  10. Extraction when data with a volume filter set is sent to supplier. Zone clearance of 1mm is set, zone mode is fully in, and 2 zones are set.
    CATPDMExtractEV5Batch -prc RECV5_EXTRACT3rootprc -zoneClearance 1 -zoneMode FullyIn -zoneFilter zoneX -zoneFilter zoneY

  11. Extraction when data with an attribute filter set is sent to supplier.
    CATPDMExtractEV5Batch -prc RECV5_EXTRACT3rootprc -attributeFilter Status EQ Approved

  12. Extraction when expand capture (PVS) data with filter set is sent to supplier. This example will filter the ENOVIA V5 VPM structure using the existing Expand Capture.
    CATPDMExtractEV5Batch -prc Test_PRC -pvs Test_PVS -out -out c:\temp
    CATPDMExtractEV5Batch -pvs Test_PVS -out -out c:\temp

    CATPDMExtractEV5Batch -pvs Test_PVS -out -out c:\temp

  13. Managing the file name after extraction can be done by using
    CATPDMExtractEV5Batch –servermyServer –role myRole –user myUser –pwd myPwd\
    -out myOutputDirectory –namingRules naming.xml\
    -adddoc myEnv.DOCUMENT.RecDrw.CATDrawing.---\
    -part my Env.PART_LIST.RecRoot

  14. Suppressing the updation of CATDrawing before save, while extracting can be done by using:
    CATPDMExtractEV5Batch -adddoc PuProd2Draw.CATDrawing -out C:\Documents and Settings\xhq\My Documents\HighlightTesting\ImproveRecon\Extract -noDraftingUpdate -user myUser -pwd xxxx -role VPMADMIN.ADMIN.DEFAULT

Limitations

  1. Impact graph:

    The session to extract is not completed with "impacted by" or "impacted on" documents.

  2. Getting traces:

    The batch is based on CATIA V5 ApplicationFrame infrastructure, therefore a CATIA V5 window may appear when running the batch.
    The batch therefore needs a running window manager.
    The batch runs as a background task and its traces are not displayed in the window from which it was started. Traces can be retrieved using CNEXTOUTPUT environment variable.

  3. Batch Utility: To set direct configuration filtering such as -zoneMode, -zoneClearance, -configHandler, -zoneFilter, and -attributeFilter, the -pvs option is mutually exclusive with other options.
    Note: If both -pvs option and one of the previous options is declared, Reconciliator and Extract batch utilities will fail.

  4. -spwd option:

    • This information cannot be hidden if running processes are listed using ps -ef | grep pwd command.

    • –spwd and –pwd options are incompatible options.

Diagnostics

Possible exit status values are:

  • 0: Successful completion.
  • 4: Failure due to one or more of the standalone documents (-adddoc documents).
  • 8: Failure due to any of the following:
  • Query failed
  • Load of PDM data failed
  • Save of loaded data failed
  • 202: Connection failed.