Cannot convert data of type string to type string[].

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Display Modes
  04 April 2018
Cannot convert data of type string to type string[].

//renameWincontains the UI

global proc renameWin()
if(`window -exists myWindow`)
{deleteUI myWindow;}

// Window

window -title "Rename Object" myWindow;
columnLayout -adj 1 -w 300;
textScrollList -height 150 scrlList;
button -label "Add to List" -command addList addlist ;
text -l "New name:(dont add #)";
textField newText;
button -label "Rename" -command renameList reName;
showWindow myWindow;
//addList puts the selected items in the scrlList

global proc adList(){
textScrollList -e -ra scrlList;
string $sel[]=`ls-sl`;
for($each in $sel)
textScrollList -e -append $each scrlList;

global proc renameList()
//get all objects in scrlList
string $allItmList[]=`textScrollList -e -allItems scrlList`;

//get the new name from the textfield
string $newName=`textField -q -text newText`;

//loop through objects in TSL
//and rename
for($all in $allItmList)
rename $all ($newName+"##");
textScrollList -e -ra scrlList;

in my script erreor shows Cannot convert data of type string to type string[].
  05 May 2018
The solution is check out the shape names. Probably there are two with the same names. Rename them then try again.
reply share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 07:04 AM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.