More Feet2Fraction Issues


#1

Hello all. I’m trying to use the Springs Node Feet2Fraction and am getting results that are rounded to the nearest inch.

When I inspect the node, there seems to be an error in the code:

Any ideas on how to fix this?


#3

What version of Dynamo are you using?
image

The error is pretty straight forward. You could always define the second ft1s as a new variable.


#4

I’m using the latest build:

image

I’m also using the latest springs package:

Yeah. Your result is what I’ve been seeing in older posts for Feet2Fraction. I can’t figure out why mine is rounding. I’m reluctant to change the node’s code since I’m not well-versed in writing code (yet).


#5

All you have to do is change the name of the variable.
You can see it first gets defined about halfway down
ft1s = __Apply(f1,ft1) + "'";
then again two lines later.
ft1s = ft1s == "0'" ? "" : ft1s;
This is fine in some cases, but Dynamo doesn’t seem to like it in this code block.
Simply define the second instance as something new (ft1s2 or something) then in the last line of code make sure you’re now referencing the new variable (ft1s2).


#6

I believe redefining a variable is no longer valid except in an [imperative] block. This is to avoid some complexity in the virtual machine around associative update. Use a new variable name or write this code in an imperative code block - but you won’t be able to use replication there.


#7

I am having the same issue, i tried what Nick_Boyts said but it didnt work for me. Any suggestions on how to make that work?


#8

I am having issues with this as well. I’m using 132.2.8 on Dynamo 2.0.2. Redefining the second variable fixed the error message, but not the rounding issues.


#9

So…I don’t fully understand what is being tested for in some of these statements, but I changed
“t0 = fr3[0] == fr3[-1];” to “t0 = fr3[0] != fr3[-1];” I also made a few tweaks to output display, but those are personal preferance.
image


#10

Seems like you stumbled on a 2.0 bug:

I’ll circumvent the issue in the 2.0 release of springs. In the mean time you can edit this line like so:

t0 = String.Substring(fr3, 0, 1) == String.Substring(fr3, -1, 1);


#11

That did it! Thanks @Dimitar_Venkov!