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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

How to load global enumeration list?

RS_10128209
12-Amethyst

How to load global enumeration list?

 
ACCEPTED SOLUTION

Accepted Solutions

Well, there might not be a loader however, a utility can be written to read a file and created the global enumeration.

 

To prove this out I wrote a utility, GlobalEnumerationHelper2, that contains a method accepts two arguments, Global Enumeration Name and a List<String> of values.

 

Can easily expand this utility to read a file to get the Global Enumeration's name and the values for the enumeration.

Maybe a CSV where the first column is the Global Enumeration's name and each subsequent column holds a value for an entry. Just a thought.  Lot's of ways to do it.

 

The code is kind of complicated but once you see the pattern everything falls into place.

The global enumeration itself requires storing 3 entries into the database.

Each value in the enumeration requires storing 5 entries in the database.

 

So, is you have 10 entries in your enumeration, 3 + (5 x 10) = 53 stores to the dB. Who knew?😀

 

Run from Windchill shell looks like this:

d_graham_0-1653241253483.png

Results after run:

d_graham_1-1653241402547.png

Seems to work well.

Interesting utility to figure out.👍

 

David

 

 

View solution in original post

6 REPLIES 6

At the moment there is only an export. You can export it from your Windchill and load it to another one. But I guess you are looking to add some entries to the list and that's not possible.

I have bulk data thats why im trying to load instead of doing manually.

Well, there might not be a loader however, a utility can be written to read a file and created the global enumeration.

 

To prove this out I wrote a utility, GlobalEnumerationHelper2, that contains a method accepts two arguments, Global Enumeration Name and a List<String> of values.

 

Can easily expand this utility to read a file to get the Global Enumeration's name and the values for the enumeration.

Maybe a CSV where the first column is the Global Enumeration's name and each subsequent column holds a value for an entry. Just a thought.  Lot's of ways to do it.

 

The code is kind of complicated but once you see the pattern everything falls into place.

The global enumeration itself requires storing 3 entries into the database.

Each value in the enumeration requires storing 5 entries in the database.

 

So, is you have 10 entries in your enumeration, 3 + (5 x 10) = 53 stores to the dB. Who knew?😀

 

Run from Windchill shell looks like this:

d_graham_0-1653241253483.png

Results after run:

d_graham_1-1653241402547.png

Seems to work well.

Interesting utility to figure out.👍

 

David

 

 

Thanks d_ghaham Its working fine

ssharma
2-Explorer
(To:d_graham)

Hi David, I know this is an old post, but just wanted to check if you had attached the utility to this thread. I don't see any attachments here.

@ssharma  I did not upload my utility to this thread.

David

Announcements


Top Tags