Import of Variables and Attributes Using Configuration File

Предыдущая страницаВ началоСледующая страница

In order to import variables and attributes, when importing data from neutral formats and formats of other systems, you should manually set correspondence between the data to be imported and the objects to be created in T-FLEX CAD during import. The correspondence should be set before calling the import command. The correspondence should be set in the special ImportSettings.xml file, which is located in the C:\Users\username\AppData\Local\Top Systems\T-FLEX CAD 3D 17\Eng\ folder, where С is the operating system installation drive and username is the name of the current OS user. If there is no such file in the mentioned folder, you can copy it from the T-FLEX CAD installation folder (default CAD installation folder is C:\Program Files\T-FLEX Parametric CAD 17\Program\).

 

Configuration file may contain following elements:

 

<ImportSettings>

  <SW>

    <Attributes>

          <Variable Name="Mass_imported" Unit="kg">

              <Attribute Name="MASS"/>

          </Variable>

          <Variable Name="$Name">

              <Attribute Name="Main">

                  <Field Name="NAME"/>

              </Attribute>

          </Variable>

          <ProductStructureName>

              <Attribute Name="Name"/>

              <Attribute Name="Product_Name"/>

          </ProductStructureName>

          <ProductStructurePartNumber>

              <Attribute Name="PartNumber"/>

              <Attribute Name="PN"/>

              <Attribute Name="BOM Part Number"/>

          </ProductStructurePartNumber>

      </Attributes>

  </SW>

<ImportSettings>

 

<ImportSettings>
Root element encapsulating all others.

<SW>
Format of import. Several formats can be included into <ImportSettings>. Following formats are available: <SW> (SolidWorks), <NX>, <STEP>, <CatiaV5>, <Creo>, <SolidEdge>, <Inventor>, <PRC>, <JT>.

Only main parameters can be imported from Creo. If you need to import parameters of other categories (alternate mass properties, reported mass properties, legacy), create some main parameters and equate them to the parameters that need to be imported via relations, then specify the created main parameters in the configuration file.

Correspondence between the data to be imported and the objects to be created in T-FLEX CAD during import is set individually for each format using <Variable>, <ProductStructureName> and <ProductStructurePartNumber> elements inside the format element.

<Variable>
A variable to be created in T-FLEX CAD upon import. It is mandatory to specify a name of variable as the Name parameter. Optionally, you may also specify variable's units of measurement as the Unit parameter. Units are specified in accordance with their ShortName defined in the TFUnits.xml file. The TFUnits.xml file is located in the T-FLEX CAD installation folder (default CAD installation folder is - C:\Program Files\T-FLEX CAD 17\Program\).

Units are not being converted. E.g., if a variable to be imported have a value 1000 and units g, and the units of the corresponding T-FLEX CAD variable are kg, then, upon import the T-FLEX CAD variable will be 1000 kg.

o<Attribute>
The <Attribute> element inside the <Variable> element defines the imported variable or attribute, whose value will will be assigned to the <Variable>. The <Attribute> element should be defined in one of the following ways, depending on the import format:

all formats, except NX and Inventor
The name of variable or attribute to be imported is specified directly in the <Attribute> element as the Name parameter.
In the example below, the numeric Mass_imported variable will be created in T-FLEX CAD upon import. The value of the Mass_imported variable will be imported from the MASS variable or attribute. The units of the Mass_imported variable will be set to kg:

 

<Variable Name="Mass_imported" Unit="kg">

 <Attribute Name="MASS"/>

</Variable>

 

NX and Inventor
Variables or attributes to be imported belong to named groups or categories. The Name parameter of the <Attribute> element defines the name of the group or category. The name of the variable or attribute to be imported is specified as the Name parameter of the <Field> element, which is located inside the <Attribute>.
If you do not specify the Name for the <Attribute> element, then the system will search within all groups and categories for the variable or attribute specified in the <Field> element.
If you do not use the <Field> element, as specified above for other formats, then the first found variable or attribute of any name belonging to the <Attribute> group or category will be imported.
In the example below, the textual $Name variable will be created in T-FLEX CAD upon import. The value of the $Name variable will be imported from the NAME variable or attribute belonging to the Main group or category:

 

<Variable Name="$Name">

 <Attribute Name="Main">

         <Field Name="NAME"/>

 </Attribute>

</Variable>

 

A single <Variable> element may contain multiple <Attribute> elements. In such case, upon import the system will search for the specified <Attribute> in the order of their appearance in the configuration file. The first found <Attribute> will be imported, the rest of them - ignored.
In the example below:

If the imported file contains a PartNumber variable or attribute, then the value of the PartNumber will be assigned to the $Drawing_Number variable of T-FLEX CAD.

If the imported file doesn't contain a PartNumber variable or attribute, but contains a PN variable or attribute, then the value of the PN will be assigned to the $Drawing_Number variable of T-FLEX CAD.

If the imported file contains neither PartNumber nor PN variable/attribute, but contains a BOM Part Number variable or attribute, then the value of the BOM Part Number will be assigned to the $Drawing_Number variable of T-FLEX CAD.

If the imported file contains none of the listed variables or attributes (PartNumber, PN, BOM Part Number), then the $Drawing_Number variable of T-FLEX CAD will not be created.

 
<Variable Name="$Drawing_Number">

 <Attribute Name="PartNumber"/>

 <Attribute Name="PN"/>

 <Attribute Name="BOM Part Number"/>

</Variable>

 

<ProductStructureName>
This element can be used in order to assign an imported value to the $Description standard variable. By default, this variable is linked with the content of the eponymous column of the root record of the T-FLEX CAD product composition. The source of the value is specified in the <Attribute> element within the <ProductStructureName> element, similarly to described above.

<ProductStructurePartNumber>
This element can be used in order to assign an imported value to the $Drawing_Number standard variable. By default, this variable is linked with the content of the Part No. column of the root record of the T-FLEX CAD product composition.  The source of the value is specified in the <Attribute> element within the <ProductStructurePartNumber> element, similarly to described above.

See Also:

Import from Neutral Formats and Formats of Other CADs