NX How to run tcin_import.exe on item types with required attributes

2023-05-18T10:56:39Z
NX for Design

Summary


Details

The goal is to run tcin_import.exe to import NX *.prt files into Teamcenter as certain item types containing required attributes.

Due to required attributes condition associated to certain item types, if only specifying the item type switch without dealing with its required attributes, the import utility will fail with this error "Invalid attribute value. Key attributes and required attributes must have assigned values. Aborting import operation due to errors.


How to setup the switch on tcin_import.exe to deal with required attributes?

Solution

The solution is to run tcin_import.exe using an item type that does not contain any required attribute (like the OOTB type "Item") with dryrun switch to generate a clone log:

C:\apps\CAD\NX1980\NXBIN>tcin_import -u=gtacdba -p=gtacdba -default_t=Item -default_n=autotranslate -asse=C:\Users\native\MikeAssembly.prt -s=C:\Users\native\mikehsieh.clone -dryrun


Then edit the clone log with these two adjustments:

First Adjustment: switch to the desired custom item type, this is the type that has required attributes.

Second Adjustment: Add in sets of strings that deals with required attributes, this is done for each prt files being imported. Since there are three required attributes in our use case, we will insert 3 sets of strings shown below:

&LOG Attr_Title: a9PartType Attr_IsArray: FALSE Attr_Val: Beam Attr_Type: string

AttrInfo: Create_Descriptor Required

&LOG Attr_Title: a9Category Attr_IsArray: FALSE Attr_Val: Concrete Attr_Type: string

AttrInfo: Create_Descriptor Required

&LOG Attr_Title: a9Dimension Attr_IsArray: FALSE Attr_Val: "12 X 24" Attr_Type: string

AttrInfo: Create_Descriptor Required

These sets of strings are inserted under each imported prt files:


See NX Help Doc below on syntax dealing with required attribute:

https://docs.plm.automation.siemens.com/tdoc/nx/1899/nx_help/#uid:xid909877

Now run tcin_import.exe using the load log file switch:

C:\apps\CAD\NX1980\NXBIN>tcin_import -u=gtacdba -p=gtacdba -l=C:\Users\native\mikehsieh.clone


The import is successful and native NX prt files are imported into TC with that required attribute custom item type


KB Article ID# PL8717552

Contents

SummaryDetails

Associated Components

Teamcenter Integration for NX