TeamcenterKnowledge

Data sharing utilities

import_file

Imports files into the Teamcenter database according to a set of user-specified arguments. These arguments supply user identification information, dataset information, and (optionally) item information to be associated with the imported file. The arguments may be specified on the command line to import a single data file or in a file to import multiple data files (bulk import). Depending on the arguments, each data file is copied (an ImanFile object is created), a dataset is created (or modified), and if specified, an item is created or modified to contain the dataset. In the absence of a specified item, the dataset is placed in the user's Newstuff folder. The import_file utility does not support the creation of custom item types. Syntax import_file [-u=user-id {-p=password | -pf=password-file} -g=group] -f=file-name | -i=file-name [-vb] [-log=file-name] -type=datasettype -d=dataset-name -ref=named-reference [-de={n | e | a | r}] [-item=item-id | -itemkey=key-id] [-itemRevUid=item-revision-uid] [-relationType=relation-type] [-use_ds_attached_to_rev_only] [-revision=item-rev-num] [-ie={n | y}] [-desc=string] [-v=volume-name] [-h] Arguments -u Specifies the user ID. This is a user with Teamcenter administration privileges. If Security Services single sign-on (SSO) is enabled for your server, the -u and -p arguments are authenticated externally through SSO rather than being authenticated against the Teamcenter database. If you do not supply these arguments, the utility attempts to join an existing SSO session. If no session is found, you are prompted to enter a user ID and password. -p Specifies the password. This argument is mutually exclusive with the -pf argument. -pf Specifies the password file. For more information about managing password files, see Manage password files. This argument is mutually exclusive with the -p argument. -g Specifies the group associated with the user. If used without a value, the user's default group is assumed. -f Imports a single file into Teamcenter. The full path must be provided if the file does not reside in the current working directory. The -f and -i arguments are mutually exclusive. See example 1. -i Imports multiple files into Teamcenter using a specified import file. The full path must be provided if the file does not reside in the current working directory. The -f and -i arguments are mutually exclusive. See example 2. -vb Runs utility in verbose mode. Displays maximum amount of information. Nonverbose sessions only display error messages. -log Creates a log of items and datasets created. -type Defines the dataset type in Teamcenter, for example, Text or UGPART datasets. -type is case sensitive and must match the dataset type name as defined in the Teamcenter data model. -d Specifies the name of the dataset into which the file is imported. -ref Specifies the type of named reference associated with the file. The value specified by this argument may or may not be identical to the value specified by the -type argument. For example, Text or UGPART type datasets have named references of Text and UGPART, respectively. However, DirectModel type datasets have a JTPART named reference. Each dataset type defines one or more named references to be associated with it. See restriction numbers 1 and 2. -de Indicates that a dataset exists. Used when a dataset of the same name already exists. =n Specifies that a new dataset be added even if one with the same name exists. If it does exist, it is added to the same item folder. If it does not exist, it is placed in the new item folder or the user's Newstuff folder. =e Specifies that a new dataset be added if the dataset name specified by the -d argument is not used by any existing dataset. The utility displays an error message if you supply this argument and the dataset name specified by the -d argument already exists in Teamcenter. =a Specifies that the imported file be added as a named reference to the existing dataset. When this is done, a new dataset version is created. This version contains the additional imported named reference file. =r Specifies that a new dataset revision be created and the existing named reference be replaced with the new one. This option generates an error if the dataset has no existing named reference. -item Specifies the name of the item containing the dataset that references the imported file. -itemkey Specifies the key of the object. You can use the -item argument or the -itemkey argument. To find the key of an object, use the get_key_string utility. -itemRevUid Specifies the 14 character UID string of the item revision object where the file and dataset are to be attached. -relationType Specifies a relation to use when the IMAN_specification relation is not appropriate. If the -relationType argument is not specified, the IMAN_specification relation is used. -use_ds_attached_to_rev_only Specifies a dataset based on its name and type, but it considers datasets attached to the specified item and item revision only. The item and item revision are specified by the -item and -revision parameters, respectively. This prevents the utility from referring to datasets with the same name and type, but that are unattached or are attached to another item or revision. If you want to revise the existing dataset instead of creating a new one, the -use_ds_attached_to_rev_only parameter is particularly useful when used along with the de=r argument. -revision Specifies the item revision number and revision ID. See restriction number 3. -ie Specifies behavior if the item already exists. =n Specifies that the dataset will not be added if the item already exists. =y Specifies that the dataset may be added if the item already exists. If the item exists, but the item revision does not, an item revision is created. -desc Specifies a user-defined text description of an item that is created by the import function. If the import_file utility is creating a new revision of an existing item, this is the description of the item revision. -v Specifies the full path of the Teamcenter volume where the imported file is placed. Environment As specified in Setting up a Teamcenter command-line environment. Files As specified in Log files produced by Teamcenter. Restrictions To create a dataset in Teamcenter, the user must specify the dataset type and the named reference. When importing a file as a dataset, you must specify the named reference using the -ref argument. When importing a file into an item revision, you must specify the revision; otherwise, an error message displays indicating a missing revision. Examples To import a single operating system file, bike.dat, into Teamcenter as a UGPART dataset named my_bike_dataset, enter the following on a single line: Copy $TC_ROOT/bin/import_file -user=user-id -p=password -g=group -f=bike.dat -type=UGPART -d=my_bike_dataset -ref=UGPART To import multiple operating system files into Teamcenter, first create an input file that contains the following information: Copy -f=bike1.dat -d=my_bike1_dataset -type=UGPART -ref=UGPART -f=bike2.dat -d=my_bike2_dataset -type=UGPART -ref=UGPART . -f=binkeN.dat -d=my_bikeN_dataset -type=UGPART -ref=UGPART Run the import_file utility using the input file from example 2, entering the following command on a single line: Copy $TC_ROOT/bin/import_file -user=user-id -password=password -group=group -i=input-file Import the d:\some_file.jt file: Copy %TC_ROOT%\bin\import_file -user=user-id -p=password -group=group -f=d:\some_file.jt -type=DirectModel -d=my_jt_file_dataset -ref=JTPART Import the d:\WordDoc.doc file: Copy %TC_ROOT%\bin\import_file -user=user-id -p=password -group=group -f=d:\WordDoc.doc -type=MSWord -d=my_word_dataset -ref=word Import the d:\ExcelFileTest.xls file: Copy %TC_ROOT%\bin\import_file -user=user-id -p=password -group=group -f=d:\ExcelFileTest.xls -type=MSExcel -d=my_excel_dataset -ref=excel Import the d:\myfile.txt file: Copy %TC_ROOT%\bin\import_file -user=user-id -p=password -group=group -f=d:\myfile.txt -type=Text -d=my_text_file_dataset -ref=Text Related Topics TC XML and PLM XML Configuration for Data Import and Export Multi-Site Collaboration

Source: https://docs.sw.siemens.com/documentation/external/PL20251212545240207/en-US/tc_help/utilities_reference/avt1737253695886/import_file.html · retrieved Fri Jul 31 2026 00:00:00 GMT+0000 (Coordinated Universal Time)