4.3.3.3.4.3. Teamcenter Required Properties

[Note]Note

The template names and the item type name mentioned in this section are only examples. They are not provided by the interface. In the customer environment, completely different names may be used.

For some item types, mandatory properties are required.

In this example, the templates (Seed Part) CNS_METRIC_TEMPLATE and CNS_INCH_TEMPLATE, as well as the item type "C4_CadenasItem" (names are for illustrative purposes only) are to be used. This is an item type with required properties.

Teamcenter > "File" menu > New > Item... > Cadenas Item

Teamcenter > "File" menu > New > Item... > Cadenas Item

Teamcenter "CadenasItem"

Teamcenter "CadenasItem"

[Note]Note

If the templates and item types used are not set in both the pax file and ifnxteamcenter.cfg , the check-in in Teamcenter doesn't.

4.3.3.3.4.3.1. Configure the "pax" file

Configure the *.pax file to use the following templates ...

  • CNS_METRIC_TEMPLATE

  • CNS_INCH_TEMPLATE

... as well as the ItemType "C4_CadenasItem".

Example of a pax file

Example of a pax file

4.3.3.3.4.3.2. Configure ifnxteamcenter.cfg

Configure ifnxteamce​nter.cfg so that the new templates (compared to the minimum configuration) and the new ItemType are used:

[CreationOptions(is3d):include(CreationOptions)]
TemplateName(isMMDoc)=?_ENCODE_PARTNAME("CNS_METRIC_TEMPLATE","A") <- Template Name changed
TemplateName(isInchDoc)=?_ENCODE_PARTNAME("CNS_INCH_TEMPLATE","A") <- Template Name changed
TC_TemplatePresentationName=Cadenas part <- Name changed
TC_TemplateApplicationName=ModelTemplate <- unchanged
TC_TargetItemType=Item,C4_CadenasItem <- Type "C4_CadenasItem" added
TC_allowItemAltRep=Yes   <- Now value "Yes"

PARTadmin <-> .pax file

PARTadmin <-> .pax file

Also, enable (set) the following keys:

  • Set the Item ID pattern (optional):

    TC_ItemId_Pattern="D"nnnnnn

    NX -> Name and Attributes -> ID

    NX -> Name and Attributes -> ID

    ID in Teamcenter

    ID in Teamcenter

  • Specify which item type should be used.

    TC_ItemType=C4_CadenasItem

A Export in this state would result in an error because this configuration mandatory properties that are specified in of the ifnxteamcenter.cfg must be specified.

See the next section.

4.3.3.3.4.3.3. Record a journal entry

To determine the required properties and their internal names for the interface configuration, record a journal (macro) in NX with the type "CADENAS Item."

The following instructions will guide you through the process.

  1. Enter "journal" in the "Search" field, and then click Record Journal.

  2. Select any location in Explorer for the journal file and enter a name.

    Confirm by clicking OK.

    -> Recording begins.

  3. Open File -> New -> Item, and in the dialog box, under Names and Attributes -> Item Type, select CADENAS Item from the drop-down list.

  4. Double-click the " Value " field in ID.

  5. Enter any values in all the rows.

    [Note]Note

    If the data type is not accepted, you will receive a message.

    To avoid problems, do not use the same value twice.

    For attributes that must be unique, use a dynamically generated expression.

    The figure shows only test data

    The figure shows only test data

  6. Finally, click OK.

  7. Click " Stop Journal Recording."

  8. Open the log file in a text editor and search for attributePropertiesBuilder1.Title.

    After each occurrence of attributePropertiesBuilder1.Title, you will also find a line with .Category and a line with .DataType.

    Excerpt from the journal with sample data

    Excerpt from the journal with sample data

    attributePropertiesBuilder1.Title = "Item:c4_item_bool_prop_mdtr";    
    attributePropertiesBuilder1.Category = "C4_CadenasItem";    
    attributePropertiesBuilder1.DataType = NXOpen.AttributePropertiesBaseBuilder
    .DataTypeOptions.Boolean;

    The entries found must be entered into the ifnxteamcenter.cfg be adopted. See also the next section.

4.3.3.3.4.3.4. Set "CadDocumentAttributes" in ifnxteamcenter.cfg

Create the appropriate blocks and keys.

  1. Put in ifnxteamcenter.cfg the following key in the AttributeMapping(is3d) block.

    [AttributeMapping(is3d)] 
    Attr_Content_03=CadDocumentAttributes
    Attr_Section_03=DEFAULTATTR 

  2. Create a CadDocumentAttributes block.

  3. In this block, create the required keys.

The following section explains the schema used to create the keys and values .

4.3.3.3.4.3.5. Schema
  1. In the CadDocumentAttributes block, create a key with the name listed under "Title " in the recorded journal.

  2. Add a second key with the same name, with " .custom " appended to the end.

  3. In the key, enter ".custom" and enter the following attributes from the journal as values:

    category.<attribute from .Category>,type.<attribute from .DataType>

    Example:

    category.     C4_CadenasItem       ,type.        boolean 

    DataType can have the following types:

    • boolean

    • number

    • integer

    • string - Do not specify this type in the CFG. It is the default.

  4. In the key, enter the value found in the journal as the value, without ".custom".

    • boolean - true|false

    • number - for example, the value 88.0

    • integer—for example, the value 89

    • string - for example, value xyz

  5. Repeat all the steps for all attributePropertiesBuilder1.Title entries found in the journal.

4.3.3.3.4.3.6. Test Export

After exporting again, you will see the result in Teamcenter.

[Note]Note

If you forgot to specify a required property, the following error message will appear.