Grasshopper

algorithmic modeling for Rhino

We have been debugging the finches Import SHP Component. Now the components can also import dbf files with non-ASCII characters.


Let me know if there are any other bugs. This helps us debug the components.

Views: 4392

Attachments:

Replies to This Discussion

Friend this works perfectly!

To use the components, you need to use Rhino 5, Grasshopper 9.0014 and the GHPython component.

Hello Carlos,

I've tried the definition you've posted but it doesn't work.

I always get some errors in the first PythonScript Component.


0. Runtime error (ValueErrorException): invalid integer number literal
1. Traceback:
  line 554, in ShpFileToRhino, "<string>"
  line 570, in script
  line 58, in dbfreader, "<string>"
  line 436, in _readDbfTable, "<string>"
  line 337, in __init__, "<string>"

What can I do?

Best,

Martin.

Hey Martin,

Would you send me the SHP file or the url where you downloaded the shp file that you're trying to import? It has to do with some character in the dbf file that the component can't read.

Of course.

www.naturalearthdata.com/http//www.naturalearthdata.com/download/10...

It's a global map from the Natural Earth project.

Thanking you in anticipation for your effort.

try this. Let me know if it works. Just added an exception to the code, so it can run even if it finds an invalid character. This is working for now, but I will need to go back to the code later to make it more robust.

best,

carlos

Attachments:

It works great.

Thank you very much for your help.

I will keep an eye on the developement.

Best,

Martin.

thanks for the component!

so as far as i understand this is all the .py files in one component, right?


now i was able to get the curves from my shp file into the viewport but how can i link the output geometries to the corresponding dbf data?

for example: id like to display the names of the vienna districts (string from dbf) at the centroid of my district curves. is it even possible?

figured it out!

i forgot to use the second component!

hello Carlos! I want to add an shp file to gh, but as the lines have not been projected, there is no prj file. can you add an exception to the code, so that it can run even if there is no prj file? thank you!!

never mind, eventually i figure it out, thanx :)

Hey, these components are really great, but I'm running into a problem importing a .shp file of points.  The error I am getting is this:


0. Runtime error (MissingMemberException): 'Point3d' object has no attribute 'SetUserString'
1. Traceback:
line 473, in addUserStrings, "<string>"
line 501, in shpToPoints, "<string>"
line 562, in ShpFileToRhino, "<string>"
line 572, in script

The shape file I am using can be found here: https://data.cityofnewyork.us/Education/School-Point-Locations/jfju...

Oddly, the standard Rhino .shp file importer can import the points on a gh 0.9.0056 install, but not on a gh 0.9.0061 install.  I can't test the Finches Import SHP component on the 0.9.0056 install at the moment.

RSS

Translate

Search Grasshopper

Photos

  • Add Photos
  • View All

© 2017   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service