I have seen many customers faced with this issue when they first start using Windchill. They realize that they can search parameter values in Windchill and they either have never used them or they have but have not designated them. Usually, they check everything into their new system and tell everyone to update parameters as they modify files. We all know that will take forever and can be very stressful. For Part 3, I am going to show you how to automate adding, updating, and designating parameters in your Creo files. I promise it will be faster than your mapkeys. Initial Conditions: For this example, I am assuming you have not checked in any files into Windchill and you have all your files on a hard drive somewhere. This will make things a little bit easier but we will get to automating this with existing files in Windchill in a later part. I am also assuming you have clean data i.e. files open without popups or regeneration issues. Error handling will also be dealt with in a later part. Step 1: Creating the Attribute Mapping CSV In order to automate this task, we need to know what files to look for and what attributes, attribute values, and attribute types to use for each file. Let's start with creating a CSV of file names with this little script below. Code Editor
Initially, this looks great but there are issues here.
Now we have only unique and unversioned files. Step 2: Populating the Attribute Mapping CSV Take the CSV file we created and open it with Excel. Then add columns with parameters names, types, and values as in the below screenshot. I have added one of each type for reference as well as simple dummy values. Even though I have only added 4 attribute columns, the script I will show you has no limit to how many it can accept. Step 3: Running the Parameter Automation Script I have rearranged some variables from the original "Open Creo" script to work with the new loop I have created. The script below will:
Parameter Automation Script
There you go! You now have another way to impress your boss. Tell them about how much money you just saved the company or use the extra time to slack off. Your choice.
6 Comments
macaba
4/6/2017 01:46:16 am
What a legend Erick - this works perfectly, and im a Powershell noob too, thanks a million
Reply
Amir
10/19/2023 03:33:27 am
I used the same procedure, but the last script did not work on my machine.
Reply
12/28/2017 12:44:18 pm
Excellent. Using Powershell with the .NET API for Creo. Did not know that was a thing.
Reply
Steven
1/19/2021 06:53:09 am
Is the method for designating parameters of models which are already in Windchill also available?
Reply
Apurvi Veldandi
2/2/2021 04:54:03 am
I wish to perform the similar activity on parts that are already checkedin in WIndchill. Is it possible ? if yes please assist
Reply
Your comment will be posted after it is approved.
Leave a Reply. |
AuthorErick Johnson Archives
May 2024
Categories
All
|