Skip to main content
12-Amethyst
May 1, 2024
Solved

Loader for Legal Value Lists

  • May 1, 2024
  • 2 replies
  • 1244 views

Version: Windchill 12.0

 

Use Case: Deployment Automation


Description:

Hi all,

 

As a part of deployment automation I wanted to know if there is any way to Export and Import Type Constraints especially Legal Value Lists easily. Like maybe a Loader file. 

Best answer by HelesicPetr

Hi @MV_10441462 

You can automate the import of the softtype configuration by OOTB function loadfromfile.

https://www.ptc.com/en/support/article/CS30168

If you create type and attribute configuration you can export it and then use it for import many times you want. 

It exports also all constraint settings.

PetrH

 

2 replies

18-Opal
May 1, 2024

@MV_10441462 

 

Yes, this is very doable.

I’ve added legal list constraints using a Java utility that I wrote.

Inputs are the Type, the attribute (that the constraint is applied to) , the list of values to be in the legal list.

Works by reading a text file with the appropriate inputs too, which I use for bulk loading.

Works well.

 

I have not tried to do an export but I would think that’s easier to write a utility to do that than to create a constraint.

12-Amethyst
May 1, 2024

@d_graham Can you share the snippet to add legal list constraint?

HelesicPetr
22-Sapphire II
22-Sapphire II
May 2, 2024

Hi @MV_10441462 

You can automate the import of the softtype configuration by OOTB function loadfromfile.

https://www.ptc.com/en/support/article/CS30168

If you create type and attribute configuration you can export it and then use it for import many times you want. 

It exports also all constraint settings.

PetrH

 

12-Amethyst
May 2, 2024

@HelesicPetr Thank you. Yes, just found that the export can be done using TypeDefinitionExporter and import can be done using TypeDefinitionLoader both programatically and LoadFromFile utility.