ICE string- number of characters

171 views
Skip to first unread message

Chris Marshall

unread,
Mar 14, 2012, 9:46:55 AM3/14/12
to soft...@listproc.autodesk.com
Hello,
I'm using strings in ICE for the first time. What I want to do is type a string of characters, then get ice to give me the number of characters in the string. I can just manually enter that value, but it would reduce 1 step from the user input if ICE could do it.
Thanks
Chris

Ciaran Moloney

unread,
Mar 14, 2012, 9:52:26 AM3/14/12
to soft...@listproc.autodesk.com
Try: string to array > get array size

Ciaran

Sebastian Kowalski

unread,
Mar 14, 2012, 9:53:48 AM3/14/12
to soft...@listproc.autodesk.com
string to array, get array size ;)



Leonard Koch

unread,
Mar 14, 2012, 9:55:17 AM3/14/12
to soft...@listproc.autodesk.com
Hm, unless the characters you are entering follow either this: 1, 4, 6, 9, 3 or this: 4 5 3 2 8 notation, I'm afraid you are out of luck...
If they do, then converting that string to an array(String to Array-node) and then getting the size of that array will work.

Fabricio Chamon

unread,
Mar 14, 2012, 9:57:25 AM3/14/12
to soft...@listproc.autodesk.com
I think it doesn't work for strings

Fabricio Chamon

unread,
Mar 14, 2012, 9:58:19 AM3/14/12
to soft...@listproc.autodesk.com
... I mean, the "String to array" conversion

2012/3/14 Leonard Koch <leonard...@gmail.com>

Chris Marshall

unread,
Mar 14, 2012, 10:03:23 AM3/14/12
to soft...@listproc.autodesk.com
Yes that's what I'm finding. It doesn't output the correct result.

Leonard Koch

unread,
Mar 14, 2012, 10:08:49 AM3/14/12
to soft...@listproc.autodesk.com
It does as long as you follow one of the notations I described above, so either separated by a whitespace or a comma.
Numbers get converted into the respective scalar they represent and groups of characters or words, get converted to zeros.

It's a little screwy, you have to trick it by for example plugging the output port of the String to Array node into the factor-port of a Multiply by Scalar-node.

Chris Marshall

unread,
Mar 14, 2012, 10:17:09 AM3/14/12
to soft...@listproc.autodesk.com
I see. Sorry I though you were saying if I was using one of those notations it would screw up. Well I'll just manually type the number in for the time being as adding spaces or commas will screw it up else where.
Thanks anyway.

Sebastian Kowalski

unread,
Mar 14, 2012, 10:20:58 AM3/14/12
to soft...@listproc.autodesk.com
use commas, and after that a split string node, you will be able to seperate the strings into an array

Stephen Blair

unread,
Mar 14, 2012, 10:20:54 AM3/14/12
to soft...@listproc.autodesk.com
If it's a string like "Testing" or "1223455" you can do it with a While loop and Get Sub String.
If you can live with that.


From: softimag...@listproc.autodesk.com [mailto:softimag...@listproc.autodesk.com] On Behalf Of Leonard Koch
Sent: March-14-12 10:09 AM
To: soft...@listproc.autodesk.com
Subject: Re: ICE string- number of characters

It does as long as you follow one of the notations I described above, so either separated by a whitespace or a comma.
Numbers get converted into the respective scalar they represent and groups of characters or words, get converted to zeros.

It's a little screwy, you have to trick it by for example plugging the output port of the String to Array node into the factor-port of a Multiply by Scalar-node.

On Wed, Mar 14, 2012 at 2:58 PM, Fabricio Chamon <xsim...@gmail.com<mailto:xsim...@gmail.com>> wrote:
... I mean, the "String to array" conversion

2012/3/14 Leonard Koch <leonard...@gmail.com<mailto:leonard...@gmail.com>>


Hm, unless the characters you are entering follow either this: 1, 4, 6, 9, 3 or this: 4 5 3 2 8 notation, I'm afraid you are out of luck...
If they do, then converting that string to an array(String to Array-node) and then getting the size of that array will work.

winmail.dat

Sebastian Kowalski

unread,
Mar 14, 2012, 10:23:25 AM3/14/12
to soft...@listproc.autodesk.com
have a look a the pic
string_array_size.JPG

Fabricio Chamon

unread,
Mar 14, 2012, 10:29:15 AM3/14/12
to li...@sekow.com, soft...@listproc.autodesk.com
from what I understood Chris wants a string to char array conversion...not a word array.

Sebastian Kowalski

unread,
Mar 14, 2012, 10:36:16 AM3/14/12
to Fabricio Chamon, soft...@listproc.autodesk.com
so use char instead a full word. next problem would be how to concatenate all the char back to a full string

Sebastian Kowalski

unread,
Mar 14, 2012, 10:39:09 AM3/14/12
to soft...@listproc.autodesk.com
guess the easiest way is to loop thru the whole string


Am 14/03/2012 15:29, schrieb Fabricio Chamon:

Chris Marshall

unread,
Mar 14, 2012, 10:41:50 AM3/14/12
to li...@sekow.com, soft...@listproc.autodesk.com
OK got it working. For example my string is "thequickbrownfox". So I use a repeat with counter set to a max value I know will be greater than the string size, so say 100.
Then use Get Sub String to query the string 1 item at a time using the loop value. When the string returns nothing, store the loop value.
That works fine.

Olivier Jeannel

unread,
Mar 14, 2012, 11:23:03 AM3/14/12
to soft...@listproc.autodesk.com
Can you post a screen grab ?

Fabricio Chamon

unread,
Mar 14, 2012, 11:25:30 AM3/14/12
to soft...@listproc.autodesk.com
that's what I tried at first, but with "while with counter", so that it stops right after the string is empty.. didn't work, got some weird bugs...soft crashing and all those fancy stuff...

Stephen Blair

unread,
Mar 14, 2012, 11:34:45 AM3/14/12
to soft...@listproc.autodesk.com
I didn't have any problems like that with this:
http://xsisupport.files.wordpress.com/2012/03/ice-number-characters-in-string-2.png

From: softimag...@listproc.autodesk.com [mailto:softimag...@listproc.autodesk.com] On Behalf Of Fabricio Chamon
Sent: March-14-12 11:26 AM
To: soft...@listproc.autodesk.com
Subject: Re: ICE string- number of characters

winmail.dat

Alok Gandhi

unread,
Mar 14, 2012, 11:44:24 AM3/14/12
to soft...@listproc.autodesk.com
Hi Chris,

I did a bunch of custom nodes for string manipulations (on Alan Fregtman's request). They are missing for long in ICE. You could probably do all the string manipulation you need with these.

Please find attached.

Cheers !!

No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.1831 / Virus Database: 2090/4557 - Release Date: 10/17/11
Internal Virus Database is out of date.

customNodesString.zip

Alok Gandhi

unread,
Mar 14, 2012, 11:46:54 AM3/14/12
to soft...@listproc.autodesk.com
Forgot to mention, all 64 bit Win.

Chris Marshall

unread,
Mar 14, 2012, 11:58:58 AM3/14/12
to soft...@listproc.autodesk.com
Great thanks Alok. Will take a look.
I've attached the solution I came up with.

--

Chris Marshall
Mint Motion Limited
029 2002 5762
07730 533 115


Alok_Signature_email_.gif
string-screengrab-1.jpg

Olivier Jeannel

unread,
Mar 14, 2012, 2:12:28 PM3/14/12
to soft...@listproc.autodesk.com
That's super :)

Alan Fregtman

unread,
Mar 14, 2012, 3:13:01 PM3/14/12
to soft...@listproc.autodesk.com
Here's a sample setup (screenshot + emdl) I had done with Alok's stringToASCII node:

http://s3.darkvertex.com/hlinked/4forums/ICE_stringToASCII_sample1.png
http://s3.darkvertex.com/hlinked/4forums/ICE_StringToASCII_sample1.7z

I'm gonna make more examples when I have more time; maybe in the weekend.
Cheers,

   -- Alan

Fabricio Chamon

unread,
Mar 15, 2012, 11:14:01 AM3/15/12
to soft...@listproc.autodesk.com
Stephen, thanks for the screenshot. 
I didn't know the condition port also evaluates inside the loop. good to know.

Alok, these nodes are super! thanks for sharing!!

Fabricio Chamon

unread,
Mar 15, 2012, 11:16:10 AM3/15/12
to soft...@listproc.autodesk.com
ok I feel dumb about my last sentence: "...didn't know the condition port also evaluates inside the loop."
if not I could never get outside the loop... =)
Reply all
Reply to author
Forward
0 new messages