Saving Data Using the Batch Tool

You can use the Batch Import tool to save existing SOLIDWORKS data to the 3DEXPERIENCE platform. It is a command-line tool that saves the content of a directory, a single file, or single assembly structure to the 3DEXPERIENCE platform.

The file location of the batch tool is:
C:\Program Files\Dassault
    Systemes\B<release_number>xcadconnectors\win_b64\USWC\
Run the tool from the command line or the batch file as it accepts only command-line arguments.
Below are the few command-line arguments.
  • -h or --help: shows a basic use of the command
  • -f or --file: processes a single file or a single assembly structure
  • -d or --directory: processes the content of a folder
  • -o or --output: generates JSON output at a given path
  • --simul: tool operates in simulation mode the file and nothing is saved
  • --swversion: generates CGR for the specified version. If the --file or --directory option is used, the --swversion option is mandatory.
  • --drawing: processes associated drawings present in the file

If you use the -f option the save process may complete more quickly than if you use the -d option, but the process will use more memory.

If the transaction is big, the batch processing might take long, or the process might stop. If the login dialog box appears during the execution of the batch process, enter the login credentials again for the process to continue.

While the tool is running:
  • Do not start the tool again.
  • Do not perform any 3DEXPERIENCE operations in SOLIDWORKS.
If the error message Failed to start SOLIDWORKS appears, even if the tool execution is in process, click OK. The error message disappears and the execution continues.

Command Execution

The following table describes the operations that you can perform:

  Saving a single file to the 3DEXPERIENCE platform Saving the content of a folder to the 3DEXPERIENCE platform
Description This command saves a single SOLIDWORKS file to the 3DEXPERIENCE platform.
The tool processes and saves the related drawings for a part or an assembly only if --drawing argument is used in the command.
This command saves the content of the folder to the 3DEXPERIENCE platform. The tool scans the content of the given folder and searches for SOLIDWORKS files (files with .SLDASM, .SLDPRT or, .SLDDRW extensions). Other file types are not processed. Each of the SOLIDWORKS files with their referenced files is saved to the 3DEXPERIENCE platform.
The tool does not process the subfolders present in the given folder. Only if the files in the given folder have reference to files in the subfolders, the referenced files are processed.
Syntax Saving a file:

C:\>SaveInto3DEXPERIENCE.exe –-file filepath --swversion sw20xx_spxx

Saving a file with associated drawings:

C:\>SaveInto3DEXPERIENCE.exe –-file filepath --drawing
    --swversion
C:\>SaveInto3DEXPERIENCE.exe –-directory folderpath –-swversion
    sw20xx_spxx
Example

C:\>SaveInto3DEXPERIENCE.exe --file
              "C:\3DEXPERIENCE\Local Work Folder\Skateboard.SLDASM" –-swversion
              sw2019_sp05
C:\>SaveInto3DEXPERIENCE.exe --directory "C:\3DEXPERIENCE\Local Work Folder\Test"
      -–swversion sw2019_sp05

The example assumes that the tool location is declared in%PATH%. Provide a complete path for the execution of the tool.

The Check file Title for uniqueness option is not compatible with this utility. The title uniqueness is not verified and the files with duplicate titles are saved.

Command Output

At the end of the execution, the output is in the form of JSON. It provides the following details:
  • The complete path of saved files.
  • The type, Name, Revision, and Physical Id of the corresponding objects in the 3DEXPERIENCE platform. If the files contains configurations and virtual components or parts, their details are also included in the report.
The following table explains the terms included in the JSON report:
Type Description Item Components
processed The list of processed files.
  • FilePath: The complete path of the file (directory name and file name)
  • Type: The 3DEXPERIENCE type of the object.
  • Name: The 3DEXPERIENCE name of the object.
  • Revision: The 3DEXPERIENCE revision of the object.
  • PhysicalId: The 3DEXPERIENCE physical id of the object.
  • Configurations: A list of configurations. A configuration is described by:
    • SWconfigId: SOLIDWORKS id of the configuration.
    • SWconfigName: Name of the SOLIDWORKS configuration.
    • Type: The 3DEXPERIENCEtype of the object.
    • Name: The 3DEXPERIENCE name of the object.
    • Revision: The 3DEXPERIENCE revision of the object.
    • PhysicalId: The 3DEXPERIENCE physical id of the object.
  • VirtualComponents: A list of virtual components. A virtual component is described by:
    • SWvirtualIdent: A string concatenating SOLIDWORKS id of the configuration, “-“, and filename of the virtual component.
    • Type: The 3DEXPERIENCEtype of the object.
    • Name: The 3DEXPERIENCE name of the object.
    • Revision: The 3DEXPERIENCE revision of the object.
    • PhysicalId: The 3DEXPERIENCE physical id of the object.
to_be_processed The list of files to be processed. Filepath: The complete path of the file or directory.
already_processed The list of already processed files.
  • FilePath: The complete path of the file (directory name and file name)
  • Type: The 3DEXPERIENCEtype of the object.
  • Name: The 3DEXPERIENCE name of the object.
  • Revision: The 3DEXPERIENCE revision of the object.
  • PhysicalId: The 3DEXPERIENCE physical id of the object.
  • Configurations: A list of configurations. A configuration is described by:
    • SWconfigId: SOLIDWORKS id of the configuration.
    • SWconfigName: Name of the SOLIDWORKS configuration.
    • Type: The 3DEXPERIENCEtype of the object.
    • Name: The 3DEXPERIENCE name of the object.
    • Revision: The 3DEXPERIENCE revision of the object.
    • PhysicalId: The 3DEXPERIENCE physical id of the object.
  • VirtualComponents: A list of virtual components A virtual component is described by:
    • SWvirtualIdent: A string concatenating SOLIDWORKS id of the configuration, “-“, and filename of the virtual component.
    • Type: The 3DEXPERIENCEtype of the object.
    • Name: The 3DEXPERIENCE name of the object.
    • Revision: The 3DEXPERIENCE revision of the object.
    • PhysicalId: The 3DEXPERIENCE physical id of the object.
not_processed The list of files not processed.
  • Filepath: The complete path of the file or directory.
  • Reason: Explanation about the failure of the save operation.
Use the following commands to save the generated JSON output in a text file.
  • For File:

    Syntax: C:\>SaveInto3DEXPERIENCE.exe --file save_location_of_file –-swversion sw20xx_spxx -o location_and_format_of_output

    Example: C:\>SaveInto3DEXPERIENCE.exe --file "C:\3DEXPERIENCE\Local work folder\Skateboard.SLDASM" –-swversion sw2019_sp05 –o C:\temp\Report1.json

  • For Directory:

    Syntax: C:\>SaveInto3DEXPERIENCE.exe --directory save_location_of_directory –-swversion sw20xx_spxx -o location_and_format_of_output

    Example: C:\>SaveInto3DEXPERIENCE.exe --directory "C:\3DEXPERIENCE\Local work folder\Folder1" –-swversion sw2019_sp05 –o C:\temp\Report1.json

The following example is the JSON output that is displayed on successful execution of the tool. The values mentioned in the below example are for reference purpose only.
{
  "processed": [{
    "Configurations": [{
            "Name": "prd-00000400",
            "PhysicalId": "B03728D97A4000006311D9DE000203A1",
            "Revision": "A",
            "SWconfigId": 0,
            "SWconfigName": "Default",
            "Type": "VPMReference"
        }, {
            "Name": "prd-00000401",
            "PhysicalId": "B03728D97A4000006311D9DE0005B251",
            "Revision": "A",
            "SWconfigId": 1,
            "SWconfigName": "C2",
            "Type": "VPMReference"
        }, {
            "Name": "prd-00000402",
            "PhysicalId": "B03728D97A4000006311D9DE00074B23",
            "Revision": "A",
            "SWconfigId": 2,
            "SWconfigName": "C3",
            "Type": "VPMReference"
        }
    ],
    "FilePath": "C:\\3DEXPERIENCE\\My Work\\BatchSave\\EMPTY_C1_C2_C3.SLDPRT",
    "Name": "xcadmodel-DSQAL012-00000013",
    "PhysicalId": "B03728D97A4000006311D9DE001B9FFF",
    "Revision": "A",
    "Type": "XCADModelRepReference"
  }, {
    "Configurations": [{
            "Name": "prd-00000539",
            "PhysicalId": "B03728D97A4000006311EB21000C15FB",
            "Revision": "A",
            "SWconfigId": 0,
            "SWconfigName": "Default",
            "Type": "VPMReference"
        }
    ],
    "FilePath": "C:\\3DEXPERIENCE\\My Work\\BatchSave\\EMPTY_Tree_VCAssem3_VCAssem4_VCPart1.SLDASM",
    "Name": "xcadmodel-00000023",
    "PhysicalId": "B03728D97A4000006311EB2100161FD9",
    "Revision": "A",
    "Type": "XCADModelRepReference",
    "VirtualComponents": [{
            "Name": "prd-00000540",
            "PhysicalId": "B03728D97A4000006311EB2100197AAB",
            "Revision": "A",
            "SWvirtualIdent": "0-Assem3^EMPTY_Tree_VCAssem3_VCAssem4_VCPart1.SLDASM",
            "Type": "VPMReference"
        }, {
            "Name": "prd-00000541",
            "PhysicalId": "B03728D97A4000006311EB21001B6283",
            "Revision": "A",
            "SWvirtualIdent": "0-Assem4^Assem3_EMPTY_Tree_VCAssem3_VCAssem4_VCPart1.SLDASM",
            "Type": "VPMReference"
        }, {
            "Name": "prd-00000538",
            "PhysicalId": "B03728D97A4000006311EB2100001983",
            "Revision": "A",
            "SWvirtualIdent": "0-Part1^Assem4_Assem3_EMPTY_Tree_VCAssem3_VCAssem4_VCPart1.SLDPRT",
            "Type": "VPMReference"
            }
        ]
    }
  ]
}