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

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Programming language CREO

SR_CAD
13-Aquamarine

Programming language CREO

Hey, I wanted to know the name of the programming language which is used in CREO (the language to create macros..).

I only found this message on the internet : https://community.ptc.com/t5/System-Administration/In-what-programming-language-is-PTC-Creo-Parametric-written-in/m-p/536946#M19492.

ACCEPTED SOLUTION

Accepted Solutions
tbraxton
22-Sapphire I
(To:SR_CAD)

You can edit this "code" in a text editor and some users do this, The syntax is specific to Creo Parametric as far as I know. I will warn you that it is not documented by PTC so it will involve much effort to develop it without using the record function. I am among a small group of users that would like to see PTC document the syntax but to date they have not been willing to do this. Also take not that fundamental programming concepts such as looping, search, etc. are not supported for map keys.

 

Check out these threads for some more tips:

https://community.ptc.com/t5/System-Administration/Mapkey-Writing-Editing-Tips/m-p/443729

 

https://community.ptc.com/t5/System-Administration/Notepad-User-Defined-Language-files-for-Creo-Parametric-and-Pro/m-p/451745 

 

 

 

 

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

View solution in original post

7 REPLIES 7
tbraxton
22-Sapphire I
(To:SR_CAD)

No API (programming language) is required to create macros. PTC refers to them as map keys and they can be recorded directly using the UI,

Refer to this link to get started.

http://support.ptc.com/help/creo/creo_pma/usascii/index.html#page/fundamentals/fundamentals/fund_five_sub/About_Mapkeys.html 

 

There is support for Visual Basic, Java, and C in Creo that can be used to create macros but are not necessary.

========================================
Involute Development, LLC
Consulting Engineers
Specialists in Creo Parametric
SR_CAD
13-Aquamarine
(To:tbraxton)

Right we can use the recording tool but what if we want to modify directly the config.pro file, like this code below.

mapkey 2nss @MAPKEY_LABELNo specific status V2;\
mapkey(continued) ~ Command `ProCmdViewVisTool` ;\
mapkey(continued) ~ Arm `visual_dlg0` `Table` 2 `default` `name_column`;\
mapkey(continued) ~ Select `visual_dlg0` `Table` 2 `default` `name_column`;\
mapkey(continued) ~ Activate `visual_dlg0` `PropertiesBtn`;\
mapkey(continued) ~ Select `visual_dlg0` `ExtLay.ItemRefList` 1 `-1:69:[40]`;\
mapkey(continued) ~ Activate `visual_dlg0` `ExtLay.RemoveOperationButton`;\
mapkey(continued) ~ Close `visual_dlg0` `visual_dlg0`;

Is this a programming language only used for PTC ?

tbraxton
22-Sapphire I
(To:SR_CAD)

You can edit this "code" in a text editor and some users do this, The syntax is specific to Creo Parametric as far as I know. I will warn you that it is not documented by PTC so it will involve much effort to develop it without using the record function. I am among a small group of users that would like to see PTC document the syntax but to date they have not been willing to do this. Also take not that fundamental programming concepts such as looping, search, etc. are not supported for map keys.

 

Check out these threads for some more tips:

https://community.ptc.com/t5/System-Administration/Mapkey-Writing-Editing-Tips/m-p/443729

 

https://community.ptc.com/t5/System-Administration/Notepad-User-Defined-Language-files-for-Creo-Parametric-and-Pro/m-p/451745 

 

 

 

 

========================================
Involute Development, LLC
Consulting Engineers
Specialists in Creo Parametric
SR_CAD
13-Aquamarine
(To:tbraxton)

Thank you for your response !

tbraxton
22-Sapphire I
(To:SR_CAD)

If you do want to use a text editor to manage Creo config files I would suggest using Notepad++ and installing the custom Creo language definitions created by @DomenicLaritz.

 

The Language definitions can be found here:

https://github.com/DonChunior/Creo-Configuration-Files 

 

Thread here:

https://community.ptc.com/t5/System-Administration/Notepad-User-Defined-Language-files-for-Creo-Parametric-and-Pro/td-p/451745 

========================================
Involute Development, LLC
Consulting Engineers
Specialists in Creo Parametric
SR_CAD
13-Aquamarine
(To:tbraxton)

I'm indeed using Notepad++, I will check out this custom Creo language definitions, thx.

remy
21-Topaz I
(To:tbraxton)

To add to @tbraxton accurate reply, the mapkey syntax is indeed undocumented.

It is a script, more than a language, generated by Creo in order to be re-used by Creo. It collects commands as outputs and as such it does not offer programming instructions (conditions, loops, etc).

Practices amongst CAD admins have proven that some tweaking is possible (combining texts, replacing value here and there) and tolerated by Creo.

The risks of creating a mapkey with a text editor and then input it in Creo are many (transtyping, encoding); that's why mapkeys generated by Creo are exclusively supported.
Inversely PTC cannot be held accountable for mapkeys not created by Creo (a text editor for example).

Announcements


Top Tags