Importing 3DXML Files Using a Batch in Command Line

You can generate an xml file containing input parameters by defining a set of run time variables, enabling you to automate the import process of 3DXML files. This approach lets you execute the batch process from the command line, without manual interaction.

To run the batch in command line, you can use CATBatchStarter, which executes PLM batch files directly from the command line without launching the Batch Monitor application.

Alternatively, CATUTIL lets you run PLM batch files from the command line while still relying on the Batch Monitor. For more information about CATUTIL and CATBatchStarter, see Running the Batch Monitor.

  1. Set the run time variables.
    Define following run time variables for generating input parameters xml during import:
    Run-time Variable Description
    XMLthruAPI Creates input parameters xml file without interacting with the user interface

    For example: set XMLthruAPI=1

    ImportFilePath Location where the 3DXML file is available for import

    This file path is appended to the input parameters xml file.

    For example: set ImportFilePath=D:\

    ImportFileName Name of a 3DXML file to be imported

    This file name is appended to the input parameters xml file.

    For example: set ImportFileName=test.3dxml

    ImportFileDescription Extraction details

    This description gets appended to the input parameters xml file.

    For example: set ImportFileDescription=text

    ImportMode Options used for import such as Import "as New" or Import "as Reference"

    If the option is Import as New, the value is set as one else for Import as Reference, it is set as zero.

    For example: set ImportMode =1

    ImportPrefix Prefix used for Import "as New" option

    This prefix value is appended to the input parameters xml file.

    For example: set ImportPrefix=Copy Of

    ImportEnvironmentID Environment for import

    For example: set ImportEnvironmentID=Engineering_Hub

    ImportExchangeMode Mode of data exchange for import

    For example:

    • set ImportExchangeMode= FileExchanges
    • set ImportExchangeMode= ProjectSpace
    • set ImportExchangeMode= TeamWorkspace
    ImportProjectSpaceName Name of a project space where the 3DXML file is imported

    This file is available in the Outbox folder in the specified project space.

    Note: For File Exchanges mode, the ImportProjectSpaceName is set as an empty string.

    For example: set ImportProjectSpaceName=PS001

    ImportTeamWorkSpaceName Name of a team workspace where the 3DXML file is imported

    This file is available in the Outbox folder in the specified team workspace.

    Note: For File Exchanges mode, the ImportProjectSpaceName is set as an empty string.

    For example: set ImportTeamWorkSpaceName=PS001

  2. Run CAAAdpUtilities to create a customized batch.
  3. Run the customized batch to obtain a list of queried objects that needs to import in the database.
  4. Create an input parameter xml file using the exposed CAA API, CATPLMBatch.

    This xml file contains detailed information about the queried objects and the appropriate values set for run time variables.

    The following is an example of a sample batch:

    Import3DXML_API_test M1 evaaix1plb:6750 user **pwd** VPMDESIGNER.VPM.DEFAULT -license D:\\CAADLCLicenseFileForPLMBatch.txt -ParamXMLFilePath e:\users\my_parameters.xml

    Where

    M1= repository name

    evaaix1plb:6750 = server name and port number

    xyz=user name

    **pwd** = password

    VPMDESIGNER.VPM.DEFAULT = credentials

    -license D:\\CAADLCLicenseFileForPLMBatch.txt = license name and path

    -ParamXMLFilePath e:\users\my_parameters.xml = paramxml file name and path

  5. Run CATBatchStarter batch using the input parameters xml file as an input.

    The following is an example of the command used for running the import bath:

    CATBatchStarter -input e:\users\my_parameters.xml -output e:\users\output
    Warning: An error message appears in the following cases:
    • The file path provided for importing 3DXML file is invalid.
    • The file path does not have Read permission.