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

How to load global enumeration list?

RS_10128209
6-Contributor

How to load global enumeration list?

 
1 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

4 REPLIES 4
bmr
17-Peridot
17-Peridot
(To:RS_10128209)

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.

RS_10128209
6-Contributor
(To:bmr)

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

 

 

RS_10128209
6-Contributor
(To:d_graham)

Thanks d_ghaham Its working fine

Announcements