cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Need a help during creating a Mapkey of creating a Customized Drawing Name

PA_11027627
3-Visitor

Need a help during creating a Mapkey of creating a Customized Drawing Name

I need to create a mapkey to create the name of 2D drawing based on the 3D part but adding some extra strings on it for example,

If the 3D part name is V132000430010, then when I call the mapkey it will create a 2D drawing named DV1320004300100-000 

that means I need to add D< Genereted name >0-000. 

 

CREO Version: 8.0.8.0

5 REPLIES 5

If you are looking to do this with a mapkey then you will need to use an external script to manipulate the string(s). Mapkeys can only record UI actions in a Creo session. Text editing in this context you are working on is done via pausing for user input to enter text. You can call an external script with a mapkey. You can nest this external script call in other mapkeys.

 

The syntax to call an external executable is:

@SYSTEM start "path_to_your_script"

 

 

========================================
Involute Development, LLC
Consulting Engineers
Specialists in Creo Parametric

Hello @tbraxton

I'm new to this stuff, so I don't know how to write an external script to manipulate the strings and which Programming language to do so with. 

 

RPN
17-Peridot
17-Peridot
(To:PA_11027627)

It is always the same

 

  1. The mapkey execute something what you can parse 
  2. Now execute your external program to parse this data
  3. This will prepare a config with a mapkey, which does what you want
  4. load this config file
  5. execute this mapkey

Spend some hours, and Voilà it works😉

 

PA_11027627
3-Visitor
(To:RPN)

Hello @RPN

 

I want to know more about the external program to parse this data, so what language will be done with? 

RPN
17-Peridot
17-Peridot
(To:PA_11027627)

This is tuff to answer without getting some members angry 😀

 

I give you 3 out of hundreds ...

 

  1. Powershell - you don't need to install, and you can probably run immediately on your machine 
  2. Python - This is the one beloved at this time (Interface builder is done with Tk, integration so ugly in my point of view)
  3. Tcl/Tk - 10 rules, easy string handling and simple, but powerful  GUI Builder, download and start the widget demo, use 'see code' here!

 

Now be prepared to get more recommendations 🙂

 

BTW the

Tcl Lib's are in "Common Files\apps\prodview\system\tcl8.6" and tk8.6

is part of the Creo Installation, but the executables "Wish" and "TclSh" are missing.

 

rcpedit.exe is a Tcl Program, some code is hidden, but this is written TclTk see rcpnew.tcl

 

some code to view is here

Common Files\apps\prodview\system\rcptools

 

If you copy/backup the code you can replace the PTC code, and replace the script by your own code 🙂

 

I use by myself only Tcl/Tk as a script language, because it is damm flexible if you follow the 10 rules..

 

 

 

 

Top Tags