Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
Hi,
how to add parameters in model automatically? We have alot of old parts on the server. Our machines are always updating so all the old parts are edited/used each year. This year because of technology we need to add new parameter to each part. Is there any way how to add it on checkout or with the help of modelcheck or other way how to add parameters without manual work?
Solved! Go to Solution.
The tool reads a CSV file in the format;
<EPMDocument idA2A2>,<Global Attribute Internal Name>,<Reusable Attribute Data Type>,<Attribute Target Value>
The tool reads each line.
Finds the EPMDocument
Adds the value to the attribute.
The utility could be modifiy to use EPMDocument number rather than EPMDocument id. That would not be a problem.
Just spec out how you'd like it to work and I write it that way.
Note: the utility runs includes and -commit argument. If -commit is not entered no database changes are made. The run is logged but I like to make sure we are really ready to make changes therefore the I include explicit use of -commit.
I write lots of tools, if you need help feel free to reach out to me.
BTW, this is a hobby for me now. 20 years doing this stuff but retried now and just can't stop doing the fun stuff.
The help loos like this:
David
ModelCheck can be run in batch mode to update parameters in a file or a directory of files.
Yes it can but i only want to add parameter if it doesn't exist. Modelcheck do force update/add on parameter which is written in start configuration. Some model do now have this parameter and i don't want to touch it with modelcheck.
Is there any possibility to check existence of parameter?
Are you wanting to add a constant parameter or a variable one?
By constant, I mean the same parameter value for all parts or variable where each part may have a unique parameter added. If doing a constant, then overwriting it with ModelCheck won't hurt as it didn't change. A variable parameter add may require a custom ModelCheck batch application to be written that will add the parameters and values that you want for each part. We had a program written, at another company, almost 20 years ago when we converted from Intralink 3.4 to Windchill 7 and had to update all of the files. The program had configuration options for what was to be added and then ran in batch mode updating all files in the working folder.
To be honest there is 2 parameters:
1st one will be constant that user define.
2nd one is relation dependent.
All of them works the same rule it has to be added with initial value "-" so relations can work with it and modelcheck can check the value of user defined one. After modelckeck add this two parameters with initial value user and relations can enter it's correct values.
Why automatically add parameter that user has than edit by hand?! Because it can than be edited via modelcheck window or via windchill.
As i can see from other answers most of the users does thid using customization. (So bad that this simple functionality has to be done that much harder way)
This can be done with a custom utility. We're doing something similar using a tool that @d_graham built for us.
Is it possible to approximately describe how this tool work?
Thank you.
The tool reads a CSV file in the format;
<EPMDocument idA2A2>,<Global Attribute Internal Name>,<Reusable Attribute Data Type>,<Attribute Target Value>
The tool reads each line.
Finds the EPMDocument
Adds the value to the attribute.
The utility could be modifiy to use EPMDocument number rather than EPMDocument id. That would not be a problem.
Just spec out how you'd like it to work and I write it that way.
Note: the utility runs includes and -commit argument. If -commit is not entered no database changes are made. The run is logged but I like to make sure we are really ready to make changes therefore the I include explicit use of -commit.
I write lots of tools, if you need help feel free to reach out to me.
BTW, this is a hobby for me now. 20 years doing this stuff but retried now and just can't stop doing the fun stuff.
The help loos like this:
David
Thank you. I will talk to my colleagues and we will look at possibilities what we can do about it.
Can I ask you the last question so I have full understanding of the problem. What API do you use to make your script work? There is a huge price difference in-between of them in our region so we need to choose if do in on outsource or find a person who will do it on full time. Thank you.
Please use my email address that I put in my previous rather than this site to communicate.
We can setup a Teams meeting to discuss. That's probably best.
As for "what API"?
Can you be more specific? The API to do what exactly? The utility does a lot of things to get the job done. It's a bit of complicated to explain in this thread.
Feel free to email me,
David
Currently we have two variations: