Skip to main content
DomenicLaritz
17-Peridot
July 16, 2018
Question

Copy name of model tree element to clipboard

  • July 16, 2018
  • 17 replies
  • 6470 views

Hello folks,

 

a colleague asked me if I knew a way to copy the name of a selected model tree element to the clipboard.
Since I could not find an out-of-the-box solution, I developed a small tool for this purpose myself:
"Copy Model Tree Element Name To Clipboard"
Maybe someone else would like to use the tool.

17 replies

DomenicLaritz
17-Peridot
December 7, 2020

I have released a new version 1.2.0 of the tool.
With this you can specify an optional second command line parameter /noext after the trail directory.
This will remove file extensions like ".PRT" or ".ASM".

16-Pearl
December 24, 2020

Domenic, Thank you very much for your new version.

 

I tested in creo4, when I pasted the 'part name' the result was: "End of Trail File" not the name...

 

This program only works in creo7?  Thanks

16-Pearl
December 24, 2020

Sorry, I checked it again, I had a typo in the OS mapkey.

It works fine in creo4. Thank you

1-Visitor
August 10, 2025

Hi,
I'm very interested in your script but I tried it and, with Creo Parametric 5, Paste give extra characters before and after the the name to copy.

The of the part (the name to COPY) is:
PROVA01
The result of the PASTE operationd is:
%CIPart 'PROVA01' not changes s

I checked the trail file and this  9 characters before and 15 characters after the part name.

I also tried checking the source code .au3 , but my code skills are VERY rusty.
Perhaps the character count to be parsed in the trail.txt file is in one of these files (File.au3; FileConstants.au3) that can't be downloaded? 


Any suggestions?


16-Pearl
August 11, 2025

Hi,

 

I use the tool in Creo8 and it works fine, so if you use Creo5 I think it would work well also.

I don't understand the meaning of  "not changes s". 

If your part name is PROVA01, when you paste the name, I don't see the relation with any "s"...

1-Visitor
August 11, 2025

Hi Trebla,
the text:

"%CIPart 'PROVA01' not changes s"

is exactly the sequence of characters that the Paste command returns after launching the script.
Not only the name I would like, that is, PROVA01, but also all the characters before and after how I wrote them between ""
So it seems that the .exe script makes a copy of characters higher than that it should copy from the trail.txt file

6-Contributor
March 16, 2026

Realy, REALY helpfull! Thanks a lot, it will save me a lot of time.

4-Participant
August 4, 2026

Dear,

I have been using the macro for the past few years in Creo 4 and Creo 8. We recently upgraded to Creo 12 and the thing no longer works.

Any ideas?

Dale_Rosema
23-Emerald IV
August 4, 2026

In Creo 11 they changed how mapkeys are read into the system. Look at this post:

 

 

Especially the last two posts by Martin.

4-Participant
August 4, 2026

Since we also changed computers and switched to win 11, I assume the problem is that Creo is not able to refresh the trail file fast enough. So I added a delay function to mapkey so that Creo has time to update the trail file.

4-Participant
August 5, 2026

This is my mapkey,

!mapkeyu "ki" Dodana funkcija timeout (0.5 sek), da pusti cas Creo-tu, da dokonca zapis trail datoteke
mapkey ki @MAPKEY_NAMEKopira v odlozisce;@MAPKEY_LABELKopira ime oznacenega elementa iz model Tree v odlozisce;\
mapkey(continued) @SYSTEM"cmd /c timeout /t 0.5";\
mapkey(continued) @SYSTEM"N:\\Ptc\\AUDAX_CREO12\\Aplikacije-INO\\Copy-Model-Tree-Element\\CopyModelTreeElem\\
mapkey(continued) entNameToClipboard.exe" "%TEMP%";