cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Load File from Local

Amirtharaj_K
15-Moonstone

Load File from Local

Hi Guys,

 

I am looking for existing local files that, how we can upload into Windchill through the LOAD FILES option.

 

Point 1: How we can create this excel sheet.csv?

Point 2: How we can convert into XML.

 

Regards,

Aj

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Amirtharaj_K 

This is a live example

BeginMPMWorkCenter,,PA0001,WorkA001,make,,WorkStation,,/Default/Centers,Basic,Manufacturing,,INWORK,com.ptc.windchill.mpml.resource.MPMWorkCenter,,A,,,,,,
IBAValue,Parametr1,AAA,,
IBAValue,Parametr3,CCC,,
IBAValue,Parametr5,CDA,,
EndMPMWorkCenter

Create TXT csv file,

Use csvToxml tool from Windchill Shell CMD 

check the XML output, 

load this XML to windchill

 

how to use csvToXml tool https://www.ptc.com/en/support/article/CS358782 

how to use load from file utility https://www.ptc.com/en/support/article/CS138169

 

All you can find on knowledge base

example with WTParts https://www.ptc.com/en/support/article/CS17492

example with wtDocument and primary file https://www.ptc.com/en/support/article/CS38296

 

PS> you can use load from file utility for all objects that are mentioned in the csvmapfile.txt 

PetrH

View solution in original post

21 REPLIES 21
Fadel
22-Sapphire I
(To:Amirtharaj_K)

we have below file with csv pattern 

Fadel_0-1709557446205.png

 

the conversion to xml is done by csv2xml tool https://www.ptc.com/en/support/article/CS358782 

Fede
Amirtharaj_K
15-Moonstone
(To:Fadel)

Thanks for the reply, @Fadel. I apologize for the delayed response.

Do you have any sample XML and Excel files for me to understand?

 

Regards,

Aj

 

Fadel
22-Sapphire I
(To:Amirtharaj_K)

Salam Amir,

 

would you let me know about the data you want to load , can later make a practical example  

 

BR,

Fadel

Fede
Amirtharaj_K
15-Moonstone
(To:Fadel)

Alaykumu s-salam  @Fadel Thanks for the replay..

 

For example: 

Scenario;1 I have a file like .sym, .frm, doc, excel & etc.. (I saved all my data path in excel sheet - A1 is Path and B1 is File name)

Scenario;2 Multi folder creation through loader in one Product/Library

Regards,

Aj

Hi @Amirtharaj_K 

The csv2xml tool will generate the XML for you from csv file.

here is the row with names with separator

user,name,number,category,description,standardProcessPlan,defaultUnit,folder,lifecycle,view,teamTemplate,lifecyclestate,typedef,parentContainerPath,version,iteration,organizationName,organizationID,createTimestamp,modifyTimestamp

 

Not all input have to be filled in but you can check DTD definition what is required. 

...\Windchill\codebase\registry\ixb\dtds\standard12_1.dtd\csvmapfile.dtd

HelesicPetr_0-1709803368192.png

elements with question mark in the end of string attribute name are not required. 

HelesicPetr_1-1709803441592.png

here is example with MPM WorkCenters with IBA definition

BeginMPMWorkCenter,,PA0001,WorkA001,make,,WorkStation,,/Default/Centers,Basic,Manufacturing,,INWORK,com.ptc.windchill.mpml.resource.MPMWorkCenter,,A,,,,,,
IBAValue,Parametr1,AAA,,
IBAValue,Parametr3,CCC,,
IBAValue,Parametr5,CDA,,
EndMPMWorkCenter

csvmapfile.txt contains this definition

BeginMPMWorkCenter~create~com.ptc.windchill.mpml.resource.LoadResource.beginWorkCenter~user~name~number~source~defaultUnit~category~usage~folder~lifecycle~view~teamTemplate~lifecyclestate~typedef~parentContainerPath~version~iteration~organizationName~organizationID~createTimestamp~modifyTimestamp~erpValidationCode~external~description

 

PetrH

Thanks for the replay @HelesicPetr Can you provide a live example that I can understand better and how extreme we can use the 'Load File'?

 

Regards,

Aj

Hi @Amirtharaj_K 

This is a live example

BeginMPMWorkCenter,,PA0001,WorkA001,make,,WorkStation,,/Default/Centers,Basic,Manufacturing,,INWORK,com.ptc.windchill.mpml.resource.MPMWorkCenter,,A,,,,,,
IBAValue,Parametr1,AAA,,
IBAValue,Parametr3,CCC,,
IBAValue,Parametr5,CDA,,
EndMPMWorkCenter

Create TXT csv file,

Use csvToxml tool from Windchill Shell CMD 

check the XML output, 

load this XML to windchill

 

how to use csvToXml tool https://www.ptc.com/en/support/article/CS358782 

how to use load from file utility https://www.ptc.com/en/support/article/CS138169

 

All you can find on knowledge base

example with WTParts https://www.ptc.com/en/support/article/CS17492

example with wtDocument and primary file https://www.ptc.com/en/support/article/CS38296

 

PS> you can use load from file utility for all objects that are mentioned in the csvmapfile.txt 

PetrH

@HelesicPetr  Thanks for sharing,

 

If i create individual means it's working, but how i can add the attachment individually in primary and secondary content. Refer the below attachments.

Amirtharaj_K_0-1709809756033.png

 

I already upload few data through creo, it's shown other format can we do this format in loader.

Amirtharaj_K_1-1709809928847.png

 

Regards,

Aj

Hi @Amirtharaj_K 

The objects loaded throw creo is not WTDocument so you can not use this method load from file to load EPMDocuments. 

PetrH

@HelesicPetr  Thanks for the replay and could you help me with first line.

@Fadel 

 

If i create individual means it's working, but how i can add the attachment individually in primary and secondary content. Refer the below attachments.

 

Regards,

Aj

@Amirtharaj_K 

What is not clear in the article CS38296

HelesicPetr_0-1709812667819.png

PS> the order is very important. 

BeginWTDocument

EndWTDocument

ContentFile

BeginWTDocument

EndWTDocument

ContentFile

....

PetrH

@HelesicPetr It's a little confusing for me whether I can dump all the files in a zip file or individually. Because there we can see Test.zip,Test2.zip & ,...

Regards,

Aj

zip is a primary content and the attachment is also zip file in the article example

What is confusing? 

You need to define each file individually

BeginWTDocument - defines the object in the Windchill

EndWTDocument - defines the primary content file 

ContentFile - defines the attachment file. You can use more ContentFile rows for more attachments but it has to be before next BeginWTDocument definition

 

the definition order is super important 

PetrH

@HelesicPetr 

Point:1 I want like one document will create & the Name: T1 and 2 attachments have one for Primary and other one for Secondary. Similar for T2, T3 & T4 i have a document for that also.

 

Point:2 Here which i confused all document is dump in zip and stored only in one Document or individual like T1, T2, T3...

 

Regards,

Aj

@Amirtharaj_K 

What all documents in dump are you talking about?

The source files has to be individually placed in a folder not in a one zip file.

PetrH

@HelesicPetr 

I think this will help us to understand what i asked.

I create multi-document that name are T1 |  T2 | T3| T4

Each document have a some attachments okay, Example T1 have 2 Attachments one for T1.txt (Primary) and other one is 888505.xlsx (Secondary)

Question: How we can go similar for T2 Document. (Attachments is different)

Question: T3 i can use T4.txt & 888508.xlsx, how we can map it.

 

Amirtharaj_K_1-1709813990216.png

Regards,

Aj

 

Thanks for the Quick reply @HelesicPetr 

For example, I have 1000 documents and I need to go with this order individually for each document, right? It's definitely a challenge to create on this structure, isn't it?

Reagrds,

Aj

Hi @Amirtharaj_K 

It is not so big deal if you can define all definitions in one row. 

T1 number, name, primary file location1, 1attachement file1, 1attachement file2, 1attachement file3

T2 number, name, primary file location2, 2attachement file1, 2attachement file2, 2attachement file3

TX number, name, primary file locationX, Xattachement file1, Xattachement file2, Xattachement file3

then you can write a code in excel that creates the structure definition as you need based on the csvmapfile.txt

then you just save the result to the csv file.

I did it many times. 

Also you can write own utility that can build the Windchill correct structure from you specific input. 

 

For someone who can not create any automatization by code it is challenge. 

PetrH

@HelesicPetr Thanks for the reply

For the testing purpose i test it's not work T1 only have attachments other's doesn't have. Kindly correct me if i done a wrong thing.

 

How we can add the attributes on here.

Regards,

AJ

 

Hi @Amirtharaj_K 

don't use the empty lines(rows). 

PetrH

Thanks @HelesicPetr  It's working. You taught me something new.

Top Tags