Getting an unused rod name starting with some string

S

Suresh Jeevanandam

Guest
Hi all,
I am trying to create rod object inside a cellview. I would like to
have its name start with string ( just to be descriptive.)

Right now I am doing this way,

procedure(MYgetUnusedRodName(start cvId)
prog((name)
for(i 1 1000
;Max of 1000 attempts
sprintf(name "%s%d" start i)
when(rodIsFigNameUnused(name cvId)
return(name)
)
)
error("XXLgetRodName :: Tried 1000 times, could not get a unique
rod name.")
)
)

Is there any other elegant way of doing this?
Is it possible to implement this without using return()

regards,
Suresh
 
gensym(
[ S_arg ]
)
=> s_result

Returns a new symbol based on the input argument.


e.g
some trials
gensym( "testName" ) => testName3273
gensym( "testName" ) => testName3274


Bernd
 
Bernd,
Thanks.
I think I still will have to check if the resultant
symbolToString(gensym("testName")) string is unused rod name.

regards,
Suresh
Bernd Fischer wrote:
gensym(
[ S_arg ]
)
=> s_result

Returns a new symbol based on the input argument.


e.g
some trials
gensym( "testName" ) => testName3273
gensym( "testName" ) => testName3274


Bernd
 
I think I still will have to check if the resultant
symbolToString(gensym("testName")) string is unused rod name.
Not if every ROD object has it's unique string prefix name and if
you use gensym form the beginning of the creation of your ROD objects
in the cell view.

I never had conflicts with this.

Bernd
 

Welcome to EDABoard.com

Sponsor

Back
Top