Importing and Exporting Setting Files to/from XML Format

You can import and export setting files to and from XML format.

Certain attributes in certain settings files, when exported to XML format, cannot be converted to text. The following is a non-exhaustive list identifying a certain number of settings file involved:

  • FrameConfig.CATSettings
  • FrameGeneral.CATSettings
  • DLNames.CATSettings (which can only be exported in any case using the CATSysDLExport tool)
  • Generally speaking, any settings files which manipulate DLNames cannot be exported, in particular SearchOrder et SymbolicLinks.
  • CDMA_PSMapping.CATSettings

Exporting these settings files to XML format renders them unusable.

Export :

After exporting settings files, a message like this appears confirming the operation has succeeded:

Setting xxx has yyy attributes successfully exported

where "xxx" is the settings file name and "yyy" is the number of attributes.

If the exported file is already present, the previous file will be overwritten.

Certain settings files may be empty. If you attempt to export an empty settings file, the following message is displayed:

Setting xxx is empty

where "xxx" is the settings file name, but the resulting XML file is still generated.

It is recommended not to edit the XML files manually, since the syntactical coherence of setting files is guaranteed by the interactive command

Tools > Options...

This export/import facility should simply be used as a means of capturing the state of your settings at a specific time, for the purpose of restoring the same settings for a different installation.

Import:

After importing settings files, a message like this appears confirming the operation has succeeded:

Setting xxx has yyy attributes successfully imported

where "xxx" is the settings file name and "yyy" is the number of attributes.

This task shows you how to:

Export an XML Set from a Settings File on Windows

The CATBatGenXMLSet command reads any setting file and to generate an XML file from it.

  1. To run the command on Windows, change to the default folder in which you installed the product.
  2. Enter the command:

    C:\Program Files\Dassault Systemes\B424\win_b64\code\bin\CATBatGenXMLSet Output_directory SettingName [mode]

    with the appropriate parameters:

The parameters are:

Parameter Description
Output_directory Name of the directory where the XML file will be created: (%USERPROFILE%\AppData\Local\Temp). Example: C:\Users\user_name\AppData\Local\Temp.
SettingName Name of the CATSettings file (without the
.CATSettings
extension) that you want to export to XML format. Example: Statistics.
mode Optional argument. Specify:
-admin

in order to run the command in administrator mode, which has the effect of creating the resulting file in the administrator settings environment. The default mode is user mode. No extension. If you want to understand what administrator mode is and what it is used for, refer to Configuring Settings in File-Based Settings Mode and Locking or Modifying Settings. General information about settings is provided in About Settings

Batch Output

The name of the resulting file is SettingName.xml.

Example

CATBatGenXMLSet C:\Users\user_name\AppData\Local\Temp CATStatistics

Example of Output

Let's say we have a settings file named Example.CATSettings comprising the following attributes:

Length of type float explicitly set to 17.132
Weight of type long not explicitly set (code default)
Number of type integer explicitly set to [1,2,3]

The resulting XML file will be as follows:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE CATSettingRepository [
<!ELEMENT CATSettingRepository (Attribute*)>
<!ATTLIST CATSettingRepository Name NMTOKEN #REQUIRED>
<!ELEMENT Attribute (Value*)>
<!ATTLIST Attribute Name NMTOKEN #REQUIRED
Type CDATA #REQUIRED
Size NMTOKEN #REQUIRED
Lock (Locked|JustLocked|Unlocked) "Unlocked">
<!ELEMENT Value (#PCDATA)>
]>
<CATSettingRepository Name="Example">
<Attribute Name="Length" Type="float" Size="1">
<Value>17.132</Value>
</Attribute>
<Attribute Name="Weight" Type="long" Size="0">
</Attribute>
<Attribute Name="Number" Type="int" Size="3">
<Value>1</Value>
<Value>2</Value>
<Value>3</Value>
</Attribute>
</CATSettingRepository>

Note that a size of 0 means that the attribute has not been explicitly modified anywhere in the concatenation. Its value is also the default value of the code.

Import an XML Set to a Setting File on Windows

The CATBatImpXMLSet command reads an XML settings set and generates the settings in the current environment from it.

  1. To run the command on Windows, change to the default folder in which you installed the product.
  2. Enter the command:

    C:\Program Files\Dassault Systemes\B424\win_b64\code\bin\CATBatImpXMLSet XML_File [mode]

    with the appropriate parameters:

The parameters are:

Parameter Description
XML_File Path of the XML file to import into the current environment: (%USERPROFILE%\AppData\Local\Temp\CATStatistics.xml). Example:C:\Users\user_name\AppData\Local\Temp\CATStatistics.xml
mode Optional argument. Specify:
-admin

in order to run the command in administrator mode, which has the effect of creating the resulting file in the administrator settings environment. The default mode is user mode. No extension. If you want to understand what administrator mode is and what it is used for, refer to Configuring Settings in File-Based Settings Mode and Locking or Modifying Settings. General information about settings is provided in About Settings

Batch Output

The output is a settings file in the user settings repository of the current environment, for example CATStatistics.CATSettings .

Example

CATBatImpXMLSet C:\Users\user_name\AppData\Local\Temp\CATStatistics.xml