Grasshopper

algorithmic modeling for Rhino

Hi,

I have used the code for importing CSV data from the following discussion:
http://groups.google.com/group/grasshopper3d/browse_thread/thread/8...

It worked perfectly until I installed a newer Grasshopper version (the one I had was pretty old). Is it possible that the new version needs different coding?

Any help is welcome!

Views: 4610

Replies to This Discussion

Hi Fizzgig,

could be, though it looks like that code should still work. Maybe there is a problem with DataTrees? Perhaps the data is stored in a way that is unexpected?

Is there an error message?

What does the output look like (please post a screenshot of the output as it is displayed by a TextPanel)
FYI

I don't have the file to grab a screenshot, but I tried this last night and it didn't work for me either. The Runtime message said something about not liking or expecting or knowing how to "handle 'return' inside a Sub or Set' and that was with an actual .CSV file from Excel. When I tried in with a .txt file as you mentioned about there were no runtime errors, it just returned 'Null'
Hi Gelfling and Austin,

That is exactly the same problem. See screenshot for more info.

Thank you for your help!
Attachments:
Hi Fizzgig

Sub RunScript(ByVal path As String)
If (Not IO.File.Exists(path)) Then Return False

I found that if you simply remove the word False in the above line then it works.

WT4
Thanks a lot. It works. Weird that the same code worked in the older Grasshopper.
Did you by any chance ALWAYS have the file in the older version. The thing is that Subroutines can't return anything, but my hunch is that it will cause a runtime error instead of just "killing" the sub outright. Therefore, that line would only worry about "returning" anything (and thus cause the error) if the file didn't exist. Still odd though as I thought that error would get caught a little earlier (which apparently now it is).
I can not remember exactly, but I would be very surprised (but it might be possible) if I always had a file when I used the older version. In the new version however, that doesn't matter, the error is there either way.

It is beyond my knowledge how it could work in the older version and not in the newer one, but the problem is solved, at least for me.

Hi, 

Very new to Grasshopper and VB. I am receiving an error 'Type 'On3dPoint is not defined'. Do you know a quick fix for that? Thank you in advance. 

On3dPoint is a type in the old SDK. Grasshopper now uses RhinoCommon (the new SDK) which uses Point3d.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service