Automating Table Cell Text Into a Parameter Value
Goal: Populate a PDMLink attribute value with a text string from a Creo drawing table cell.
This will examine and demonstrate how to utilize Creo mapkeys, trail files and batch files to retrieve the latest table cell text (alpha and numeric) string based upon its position in the table. Then create a new drawing parameter and paste the text string into the newly created drawing parameter value and designate it.
The solution will find the latest CR Log Number and paste the value into a newly created Creo drawing parameter. (2nd row – 2nd column “15-00125-25 02-14-15 CDE”)
Newly created parameter “CR_LOG_NUMBER” with cell text string pasted into the value and designated.
If you have one or two drawings the easiest method is to open your drawing and copy (ctrl+c) the desired text and then open your parameters and paste (ctrl+v)the text into the value. Done. However if you are dealing with hundreds or thousands of drawings then the following method can either be incorporated into a master import file or used as a stand alone mapkey that will accomplish the task in a split second ensuring accuracy while saving precious time.
Let’s Begin
Start a New Session of Creo and open the drawing.
Mapkey | Trailfile Start:
Zoom Into Area
To ensure my mouse picks are accurate when I pick the table cells, I zoom into the lower left corner of the drawing where the table is located.
Copy and Save Table Cell(s) Strings to Text File(s)
All four table cell text strings, in the column 2 cells, will be copied into four individual text files using the method as described in my YouTube video Mapkeys & Trailfiles. In this example I will start with the bottom cell and work my way up to the top.
After I have zoomed in the the area:
Table Tab
Table Cell Filter
Draw a box around the bottom table cell
Properties
Save
Type entire file path and file name
Green Check Mark
Cancel….
Then move upward and draw a box around the
next cell…
…Until all four cells have been saved as a text file.
Cancel | General Filter | Layout Tab | Refit (unZoom)
Exit Creo
Now edit the session trail and create a mapkey to run the play trail file (this will be the master trail file – additional commands will be added.
How to create a Trail File.
How to create a Mapkey to Run a Trailfile.
The next step will be to create the drawing parameter “CR_LOG_NUMBER”.
Start a new session of Creo and open the same drawing as above. Select the following commands:
Tools | Parameters |