Grasshopper

generative modeling for Rhino

generating terrain model from Text and 2D-Textposition-Points

Hi everyone,
I'm faced with a problem that seems to occur fairly regularly in my architecture studies.
I am trying to create a 3d terrain model from given points in a dxf-file.
Previously, when files had terrain contour lines , I made a grasshopper-file that divided these, took the division points, and in Rhino, with point set reconstruction tool, made a model via delauney triangulation.
Now, all I have is Rhino Text Objects and their position points in 2D. The Text Objects contain the z-value of the points. Is there a way to get the origin point of the text objects and the value of the text object into grasshopper in some sort of order, so that 3d points can be constructed?
Any suggestions, also as to how I can get the text objects as string into grasshopper, would be appreciated.
Thanks,
See Man

Tags: Grasshopper, Model, Terrain, via

Views: 3096

Reply to This

Replies to This Discussion

Hia,

I tried your code but got the follow error:

Error: Overload resolution failed because no accessible 'New' can be called without a narrowing conversion

Any ideas why?

Thanks,

Will
Here's a link to a rhinoscript that does the same thing:

http://www.rhinoscript.org/rhinoscript/44
I'm also experiencing this bug, any solutions?
Hi all, digging up an old post- but this is a much better way of modeling terrain then I've been using. The survey's I often get include both number and letter combination, and this script will only accept numeric data (of course). Does anyone know of a quick way to select or isolate only the numeric components of text from Rhino?

Sorry I just saw this, one year too late. In case anyone else needs it, the code is the following:

    Dim objref As New docobjects.ObjRef(x)

    Dim txt As TextEntity = objref.TextEntity

     Dim z As String = system.Text.RegularExpressions.Regex.Replace(txt.text, "[^0-9.]", String.Empty)

    a = New point3d(txt.Plane.OriginX, txt.Plane.OriginY, z)

 

This works when the decimal separator is a point, if it's a comma replace [^0-9.] with [^0-9,]

Hi Vicente,

I have been following this script from day one and just realized that You had updated it to only accept numeric input! Thank You for that.

That makes this little tool even more productive!

I was asked to update this script so it works in the current GH version.

It works in the following way:

Place an ID parameter, reference the text objects in this parameter, place a vb component, right click on the x input and set the type hint to GUID, connect the ID parameter to the x input. Double click on the VB component and paste the following code:

 

Dim objref As New docobjects.ObjRef(x)

Dim txt As TextEntity = objref.TextEntity

a = New point3d(txt.Plane.OriginX, txt.Plane.OriginY, txt.Text)

Thanks. They work again now .

Hi Vincente, I am wondering if we can update this thread so the script/components work in the latest GH version?  The VB Component doesn't contain an option for 'GUID' under 'type hint'.  That might be the reason I can't get it to work.  My files are below.

Thank you!

Mike

Attachments:

Mike

Make sure you are not using the VB Legacy component

I used the VB Script component instead as it has GUID support (Grasshopper version used 0.9.0014) the original code from Vincente works really well

Regards

Andrew 

RSS

Translate

Search Grasshopper

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2013   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service