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

How to easily rename imported points

karimhamdi
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?

7 REPLIES 7

Re: How to easily rename imported points

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

 

Dave

Re: How to easily rename imported points

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

Re: How to easily rename imported points

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

Re: How to easily rename imported points


@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

Re: How to easily rename imported points

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

 

Re: How to easily rename imported points

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

 

Re: How to easily rename imported points


@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
Announcements