Combining Var

Noob question, how do i get a string from the var in this node? (get the output as string)

Thanks in advance


1 Like

It depends on what you’re asking. We can only guess because you haven’t shown us what the node is returning.

If you want to convert the object to a string you can use the method @Daan suggested. If the parameter is returning an ID or an element and you want the user-facing name then you’ll have to use a different method - either a custom node (I believe Rhythm has one but I think there are multiple options available) or python.

1 Like

sorry about that, thought it was a common and a noobish question :stuck_out_tongue:
what im trying to do is get the B and H values from beams, concat them into a string and feed them into a shared parameter.

here is where i am a right now:

i have already tried the method suggested by @Daan, sadley it didnt work.

any help is really appreciated!

Ah that makes sense. You should be able to use a + node or a codeblock (b + " x " + h) to combine strings.

yes, but the Object type node didnt work, as you can see from the output of the concat node!
so if you have another node i can try ?

I don’t know why you’re using that node. It tells you the type of object you’re dealing with. Daan suggested the String from Object node, which converts an object to a string.

Once your values are strings you can combine them with either nodes that I recommended.

ok, do you have another workflow, to get the value of family type as a string ?!

It doesn’t seem like you’ve tried the first suggestion - which should work looking at those values.

  • String from Object - converts the value to a string
  • codeblock - combine string values

ah! so sorry i thought that by using the “object.Type” i was using the one you guys are refering to :sweat_smile:

and your suggestion to use the code block is perfect, one problem though, i dont want it give the zeros after “.”

any ways to filter those out??

after further help received, I got the solution, thought id share it:

Yes - this is a common issue with converting numbers to strings. You’re lucky because your values are whole numbers, so you can just use Math.Floor to convert them from doubles to integers. Integers won’t have the trailing zeroes when converted to strings.

1 Like

That also works.

1 Like