Cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

Using import_file to import bulk PDF files from OS to existing Item Revs

Valued Contributor
Valued Contributor

Background: We are doing a small migration of acquistion data into TC 11.4. The data was originally Solidworks, we've already migrated this to NX and imported the NX .prt files into TC (creating Items, revs, ugmaster datasets in the process). 

 

I now have a few thousand PDF files on the OS that I need to import to these aformentioned item revs. I've been working with import_file and have been struggling with successfully using the -item=xxx -revision=xxx arguements. I am able to get the PDF files to import successfully if I use the itemRevUid=xxx arguement, but this doesn't seem like a viable option as I don't have (or know of) a simple way to get the UID for all of the target item revs for all the PDF files.

 

Currently have this structure:

Item 1

  Item 1/A

    Ugmaster

    xxxxxNeed PDF herexxxxx

 

Question: When using the below syntax, we are getting an error in the TC Cmd Prompt stating Error: Item already exists as if it is trying to create a new item, instead of adding the dataset into the existing revision. It will create an orphan dataset, but not attach the PDF to the rev. Shouldn't this syntax just tell the utility which item/rev to attach the relation to?

import_file -u=infodba -p=infodba -g=dba -f=dwg_revA.pdf -d=dwg_revA -type=PDF -ref=PDF_Reference -item=Part1 -revision=A -log=log.txt

I've also tried adding -relationType=IMAN_specification  or  manifestation with the same results.

import_file -u=infodba -p=infodba -g=dba -f=dwg_revA.pdf -d=dwg_revA -type=PDF -ref=PDF_Reference -relationType=IMAN_specification -item=Part1 -revision=A -log=log.txt

Is there any way to do what I'm looking to do without finding the Rev UID? If not, is there a way that I can easily find the Rev UID for a list of revisions (either in search results, or in a folder) without writing code? 

 

Thanks!

Jeff

4 REPLIES 4

Re: Using import_file to import bulk PDF files from OS to existing Item Revs

Siemens Phenom Siemens Phenom
Siemens Phenom

Try with -ie=y

 

From the docs;

-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.

You may also want to take a look at the -use_ds_attached_to_rev_only option.

Re: Using import_file to import bulk PDF files from OS to existing Item Revs

Valued Contributor
Valued Contributor

Sometimes, it pays to walk away and come back to something later. @jonathan_morris exactly what I was looking for, and it was right there. I don't know how I overlooked that every time I read that page.

Thanks for being the 2nd set of eyes I needed :)

Re: Using import_file to import bulk PDF files from OS to existing Item Revs

Solution Partner Esteemed Contributor Solution Partner Esteemed Contributor
Solution Partner Esteemed Contributor
This task will take a long time since you are running import_file for each PDF. It will go much faster if you use the input file method...

import_file -user=user-id -p=password -g=group -i=my_files.dat

Where my_files.dat is a file that contains information about the files you need to import into their corresponding items.

-f=1234567_A.pdf -d=1234567_A -type=PDF -ref=PDF_Reference -item=1234567 -rev=A
-f=1234568_A.pdf -d=1234568_A -type=PDF -ref=PDF_Reference -item=1234568 -rev=A

Randy Ellsworth, Teamcenter Architect, Applied CAx, LLC
NX 11 | SW 2016 | Creo 4 | TcUA 11.4
Evaluating: AW 3.4

Re: Using import_file to import bulk PDF files from OS to existing Item Revs

Valued Contributor
Valued Contributor
Hi Randy,
Already got the input file setup, was just trying to get the syntax working with the existing revs. I forgot to mention that we were going to be using the Bulk Import method, as well as release_man to status everything once done.
Thanks for the heads up.
Jeff