Length of Line SDL not matching input data from csv

hi,

I’m using values from a csv file to inform the length of a group of SDL lines. However, the output lines do not have the same length as the list (see capture, point 1). Also, if i try to divide the value before input in the sdl line length component, i get an error message saying text could not be evaluated as an expression, and all the output is null (I check many times my csv file and the cells are number format, no spaces or error message).

How can I fix this? The lines are meant to form a bar graph, so it’s important that the length of the lines represent the data.

Many thanks,

you sorted the lengths but not the vectors or start. Add via ZUI (zoom in to the plus on Sort list and add inputs)

Hello,

I think because there is a comma instead of a dot, GH transforms your “numbers” into points X,Y,Z (with Z=0) then transforms that back into numbers by taking the distance from the point to the origin.

Try to use Replace Text to change , into .

1 Like

Your comma separated values result in the following numbers:

If the comma should be a decimal point, you can use replace text to do that…

:slight_smile: @magicteddy

1 Like

thank you, I can explain better what I did to know how that works: In the center I have located points that represent a map (the position of each city). I then drew a nurb from it to a matching point on an ellipse so I can display data more efficiently. The start of the SDL line is the point on the ellipse, and the D vector was generated by offsetting the ellipse (a bit lo-fi I know!). The problem is the original points and points on the ellipse were sorted using the angle from unit y ref vector (so going around the clock), but the data I want to display does not have an angle (it’s straight from the csv file).

I hope I could explain this clearly, so how to make sure each city displays its own value?


Thank you so much, it worked! I get this problem a lot because in french we generally use commas instead of dots. So all the data I extracted from the government is written in commas.

1 Like

It’s much easier for us to understand and to help if you post the files as well. Thanks.

3. Attach minimal versions of all the relevant files
If you have a gh file you have a question about, attach it to the post. Do not expect that people will recreate a file based on a screen-shot because that’s a lot of pointless work. It’s also a good idea to remove everything non-essential from a gh file. You can use the Internalise Data menu option to cut everything to the left of a parameter:

2 Likes

Thanks it worked!! Not used to using dots, I’ll have to keep this in mind in the future :slight_smile:

Very true! Here is the grasshopper file along with the csv containing the data.
Thank you very much :smiley: (and sorry, my scribbles are partly in french)

pop-slsj-tranches-gh.csv (3.2 KB)
script-base-pointssurcercle.gh (53.9 KB)

As a side note, if you have the possibility of importing an Excel file instead of a csv, TT Toolbox’s component converts commas to dots.

Oh! I didn’t know we could use excel format! Very useful, then no need to export as csv every time I modify the main file :smiley:

Have a look at this file, I tidied up a lot of useless stuff, and added a custom script to reorder all the wires while removing intersections. Though there is still the overlapping text problem…

There are two cities at the exact same location, is this normal ?
image

script-base-pointssurcercle.gh (25.7 KB)

1 Like

wow thank you so much! It seems more clear now. However, I can’t load the excel import function in my version of the app, thus I get this when opening the file (see capture). Is there a way to open it with file path and read file as it was before? :))

This is the TT Toolbox component, downloadable here (I use v1.9)

You can also put back the csv import component as you did in your original file.

oh that’s why. Unfortunately, everytime I try to add a component to grasshopper, I get this message :cry:

Strange issue, maybe you have a firewall blocking yak or something…

You can add a library without package manager.


Copy the files in this folder :

Restart Rhino afterwards.

thanks, i put the downloaded file in the folder. Now I get this message. I don’t see a new toolbar so I don’t know if the tt toolbar was installed successfully.


Your Rhino is not up-to-date !
Can you update ? Or maybe try with an earlier version of TT Toolbox.
You’re close !

Thank you very much for you patience, it worked! So much better than what I had! I’ll get familiar with the new script, hope it’s ok if I get back to you if I have any questions :smiling_face_with_tear: I had made my script to be able to input another excel file and still get the same result, I guess this organization was kept. Thank you again!