Greetings Forum, 1st time poster :
I have been using this code to rename my dummy instances which works fine the first time I use this but subsequent runs report that "DUMMY0" already exists. How to modify this to remember where it left off last time?
One idea I had was parsing the current cellview with
then: parsing that list with zz~>instances~>names to find "DUMMY(x)" and then start at last x+1 value.
procedure( nameDummyInst() let((cv cnt instList) cv=geGetWindowCellView() instList=selectedSet() labelLayer = list("text" "drawing") cnt = 0; initialize CNT foreach(inst instList temp1=pcExprToString( cnt ) newInstName=strcat( "DUMMY",temp1 ) inst~>baseName=newInstName cnt++; ) ;foreach ) ;let) ;procedure
Thanks in advance
I guess that you can use dbFindAnyInstByName(cv instName)
If the instance name already exists, then try next name.
foreach(inst instList newInstName=strcat("DUMMY" pcExprToString(cnt++)) while( dbFindAnyInstByName(cv newInstName) newInstName=strcat("DUMMY" pcExprToString(cnt++)) );; while inst~>baseName=newInstName
In reply to marcelpreda:
Greetings Marcel - thank you very much for your help. I tested the new code and works wonderfully.