Grasshopper

algorithmic modeling for Rhino

Hi,

i am new to GH and am learning the ropes still. I wrote a custom VBscript component that gives me intersecting lines based on borders, rays and points of intersection. My code returns essentially the segments of intersecting lines split by the borders. 

So I can get all that to work and create a new list of OnLine's and assign them to the output. However, when I plug that into a 'line' component I get:

'Data Conversion Failed from String to Line'

Plugging the output from my VB component into a panel yields: 

'Line (L:18.821498 in)' 

Shouldn't that output be a bunch of actual line objects instead of String representations of lines?

Code snippet:
Dim output_curves As New List(Of OnLine)

[ ... ]

Dim stopped_ray As New OnLine()
stopped_ray.Create(ray_start_point, p)
output_curves.Add(stopped_ray)

[ ... ]

A = output_curves

Most likely this is something silly so any pointers would be greatly appreciated!

Thanks
- J

Views: 828

Replies to This Discussion

Hi Jochen,

you sound like a clever chap, so you probably didn't plug the Panel into the Line parameter did you?

Does the VB component draw the lines in the viewport?
What do you see in the tooltip for the A output parameter?

--
David Rutten
david@mcneel.com
Poprad, Slovakia
Oh no! That was my mistake. I just rewrote it to give me point output which ended up working for me, but yes, I originally had it run though a 'Flatten' for some reason....

Thanks!
- J
The reason points would work in this case is because points can be serialized and deserialized correctly (though you might lose accuracy, since not all digits are displayed).

Be careful that you don't convert data to Strings and then back again by inserting Panels in the middle of stuff. Panels are basically String Parameters with an overridden display logic.

They'll eat anything but always spit out Strings at the other end.

--
David Rutten
david@mcneel.com
Poprad, Slovakia

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service