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

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

How to easily rename imported points

karimhamdi
4-Participant

How to easily rename imported points

When importing thousands of points from an excell sheet, Creo assigns random names to them.

Is there a way to copy and paste the points' names from the excell sheet? (Instead of renaming them one by one )

Or alternatively use a script?

10 REPLIES 10

You can do this with Nitro-PROGRAM -- for FREE.

 

Dave

Can it be done with Nitro-cell since all the point names will be imported from excell ?

Multiple paths to get there... with Nitro-CELL but it would also depend on the state of things in your model and what you are touching.

 

feature : rename expects a known "name" that you are renaming as a starting point for the function (e.g. if you know PNT123 is there - and you are renaming PNT123 -> MY_PNT9, then that 1:1 rename is easy).

 

If you are importing a bunch of points and letting Creo default the names to whatever is next - then you don't know the start names to rename to something else.   This would change the approach slightly in that case - but still could be done.

 

feature : rename_type enables you to rename features by TYPE (e.g. POINT) and use a format like MY_PNT[1] -- where [1] is the incrementer that will be added to each renaming operation ... so PNT123, PNT5894, PNT28292 ->  MY_PNT1, MY_PNT2, MY_PNT3...

 

feature : rename_pattern effectively does the same thing as rename type - but uses a group name as the reference for renaming content within it....

 

Unfortunately we don't have cool YouTube videos on these (yet) - but it is possible to use these functions to achieve your goal I think... there may be other combinations of functions and approaches -- this depends on you though...

 

Hope this helps.

 

Dave


@karimhamdi wrote:

When importing thousands of points from an excell sheet, Creo assigns random names to them.

Is there a way to copy and paste the points' names from the excell sheet? (Instead of renaming them one by one )

Or alternatively use a script?


Hi,

unfortunately I do not see any easy solution. This is because point names shown in dialog box are not visible in model tree - they are hidden inside datum point feature (this feature contains points offset from coordinate system).

 

Option no.1 ... generate mapkey (if I were you I would develop simple program, which generates mapkey code specific for current situation)

I tested this option in Creo 7.0 ... see below.

Names before modification

pnt_names_01.png

Names after modification

pnt_names_02.png

Mapkey ss code

 

mapkey ss \
mapkey(continued) ~ Select `Odui_Dlg_00` `t1.CSysPntsTbl` 2 `okit_wdg_table_row_0` `Name`;\
mapkey(continued) ~ RButtonArm `Odui_Dlg_00` `t1.CSysPntsTbl` 2 `okit_wdg_table_row_0` `Name`;\
mapkey(continued) ~ PopupOver `Odui_Dlg_00` `t1.pnts_table` 1 `t1.CSysPntsTbl`;\
mapkey(continued) ~ Open `Odui_Dlg_00` `t1.pnts_table`;~ Close `Odui_Dlg_00` `t1.pnts_table`;\
mapkey(continued) ~ Activate `Odui_Dlg_00` `t1.rename`;\
mapkey(continued) ~ Update `Odui_Dlg_00` `t1.PntNameInpPnl` `my1`;\
mapkey(continued) ~ Select `Odui_Dlg_00` `t1.CSysPntsTbl` 2 `okit_wdg_table_row_1` `Name`;\
mapkey(continued) ~ RButtonArm `Odui_Dlg_00` `t1.CSysPntsTbl` 2 `okit_wdg_table_row_1` `Name`;\
mapkey(continued) ~ PopupOver `Odui_Dlg_00` `t1.pnts_table` 1 `t1.CSysPntsTbl`;\
mapkey(continued) ~ Open `Odui_Dlg_00` `t1.pnts_table`;~ Close `Odui_Dlg_00` `t1.pnts_table`;\
mapkey(continued) ~ Activate `Odui_Dlg_00` `t1.rename`;\
mapkey(continued) ~ Update `Odui_Dlg_00` `t1.PntNameInpPnl` `my2`;\
mapkey(continued) ~ Select `Odui_Dlg_00` `t1.CSysPntsTbl` 2 `okit_wdg_table_row_2` `Name`;\
mapkey(continued) ~ RButtonArm `Odui_Dlg_00` `t1.CSysPntsTbl` 2 `okit_wdg_table_row_2` `Name`;\
mapkey(continued) ~ PopupOver `Odui_Dlg_00` `t1.pnts_table` 1 `t1.CSysPntsTbl`;\
mapkey(continued) ~ Open `Odui_Dlg_00` `t1.pnts_table`;~ Close `Odui_Dlg_00` `t1.pnts_table`;\
mapkey(continued) ~ Activate `Odui_Dlg_00` `t1.rename`;\
mapkey(continued) ~ Update `Odui_Dlg_00` `t1.PntNameInpPnl` `my3`;\

 

 

 

okit_wdg_table_row_0 ... 1st table row

okit_wdg_table_row_1 ... 2nd table row

okit_wdg_table_row_2 ... 3rd table row

my1, my2, my3 ... new point names

 

Option no.2 ... use some automation tool to execute rename action for you (for example AutoIt)

 


Martin Hanák

Thanks Martin, using Mapkeys is a brilliant idea. I can see how this would work. opened the datum points edit window and the excel sheet side by side and recorded a mapkey to copy and paste the cell value. 

The difficult part is to automate the task to run down the table and copy/paste all the cells. 

karimhamdi_0-1607090605865.png

 

 Easy... use Power Query to generate them... (and execute)

 


@karimhamdi wrote:

Thanks Martin, using Mapkeys is a brilliant idea. I can see how this would work. opened the datum points edit window and the excel sheet side by side and recorded a mapkey to copy and paste the cell value. 

The difficult part is to automate the task to run down the table and copy/paste all the cells. 

karimhamdi_0-1607090605865.png

 


Hi,

to automate the task you have to develop simple application which gets list of point names as input and generates mapkey code as its output. You import this mapkey into Creo session and run it. That's all.


Martin Hanák
liz68
6-Contributor
(To:karimhamdi)

Hi @karimhamdi ,

have you managed to create an application which gets list of point names as input and generates mapkey code as its output?

Could you share it with the community?

 

I am working on a similar problem and I'm not sure how to start with it

 

Thank you!

Cheers

Hi liz68,

 

I joined an Excel file whom create the desired macro to rename points. I developed it to rename points from dots scans.

It's based on Martin method describe above (datum points functions) and extended to the required number of points (up to 1000 points).

 

Under 2nd chapter, just choose a key to run the macro within Creo, give points names into orange cells and click on "run macro"

The macro is copied into clipboard, to be pasted into your config file.

Edit the datum points function and run the macro

 

Capture d’écran 2023-05-04 142147.png

 

Steelfoot

Hi @MartinHanak and @Steelfoot,
Thanks for the replies, this solution was perfect for my application!

 

Daniel Marton

Announcements
NEW Creo+ Topics: Real-time Collaboration


Top Tags