My PTC and associated tools are currently undergoing planned maintenance. This may impact the community, especially login. Pages may become temporarily unavailable, requiring a refresh or resubmission.

Translate the entire conversation 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

8 REPLIES 8

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
3-Newcomer
(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

@_1647
13-Aquamarine
(To:d_graham)

Hi @d_graham ,

 

I have have an excel file with 1500+ entries.

And I want to create an enumeration.

So can you share that utility which will save my time and I can create the enumeration.

 

Personally You can share that.

Hi @d_graham 
I am also doing the same task so it would be great if you can share your utility for reference. 
You can share the utility personally as well.

Announcements

Top Tags