3.3.2.3.4.3. Mandatory Teamcenter Properties

[Note]Note

The mentioned template names and the Item type's name in this section is only exemplarily. It is not provided by the interface. In the customer's environment completely different names may have been used.

For some Item Types mandatory properties are required.

In this example we want to use the templates (seed part) CNS_METRIC_TEMPLATE and CNS_INCH_TEMPLATE and the Item Type " C4_CadenasItem" (names exemplarily), which is an item type with mandatory properties.

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

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

Teamcenter "CadenasItem"

Teamcenter "CadenasItem"

[Note]Note

If the used templates and item types are not set both in the pax file and in ifnxteamcenter.cfg, the checkIn in Teamcenter will not work.

3.3.2.3.4.3.1. Configure "pax" file

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

  • CNS_METRIC_TEMPLATE

  • CNS_INCH_TEMPLATE

... and the ItemType "C4_CadenasItem".

Sample of pax file

Sample of pax file

3.3.2.3.4.3.2. Configure ifnxteamcenter.cfg

Configure ifnxteamce​nter.cfg in order to use the new templates (in compare to the minimal configuration) and the new ItemType:

[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

Furthermore activate (set) the following keys:

  • Determine pattern of Item ID (optionally):

    TC_ItemId_Pattern="D"nnnnnn

    NX -> Name and Attributes -> ID

    NX -> Name and Attributes -> ID

    ID in Teamcenter

    ID in Teamcenter

  • Determine, which item type shall be used.

    TC_ItemType=C4_CadenasItem

If you would try an export in this state, you would get an error, because this configuration is using mandatory properties and these have to be stated in the ifnxteamcenter.cfg.

See next section.

3.3.2.3.4.3.3. Record Journal

To find out the mandatory properties and their internal name used by the interface configuration, record a journal (macro) in NX using the "Cadenas Item" type.

The following instructions will guide you through the process.

  1. In the "Search" field, enter "journal" and then click on Record Journal.

  2. In the Explorer, choose any location where you want to save the journal file and enter a name.

    Confirm with OK.

    -> Recording is started now.

  3. Open File -> New -> Item and in the dialog under Names and Attributes -> Item Type, in the list field, select Cadenas Item.

  4. Perform a double-click in the Value field of ID.

  5. Fill in any values in all lines.

    [Note]Note

    If the value type is not accepted, you will get a note.

    In order to avoid problems do not use the same value twice.

    For attributes which have to be unique, use a dynamically generating expression. "

    This figure is just showing test data

    This figure is just showing test data

  6. Finally click OK.

  7. Click Stop Journal Recording.

  8. Open the journal with 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 journal with sample data

    Excerpt from journal with sample data

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

    The found entries have to be taken into the ifnxteamcenter.cfg. For this, have a look in the next section.

3.3.2.3.4.3.4. Set "CadDocumentAttributes" in ifnxteamcenter.cfg

Create respective blocks and keys.

  1. In ifnxteamcenter.cfg, set the following keys in the AttributeMapping(is3d) block.

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

  2. Create a block CadDocumentAttributes.

  3. Create the required keys in this block.

The next section will explain the schema which has to be used in order to create the keys and values.

3.3.2.3.4.3.5. Schema
  1. In the block CadDocumentAttributes, create a key with the name found in the recorded journal under Title.

  2. Add a second key with the same name, but attached .custom at the end.

  3. In the key with ".custom" insert the following attributes taken from the journal as value:

    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 state this type in the CFG. It is the default.

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

    • boolean - true|false

    • number - for example, value 88.0

    • integer - for example, value 89

    • string - for example, value xyz

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

3.3.2.3.4.3.6. Test export

After a new export you will see the result in Teamcenter.

[Note]Note

If you forgot to state a mandatory property, the following error message will occur.