Using number text objects for making a list

Hi there,

 

I'm wondering if there's any way I can take a bunch of text object numbers from rhino and use them as a list of integers in grasshopper.

I basically have a site model to make with several hundred blocks that would have to be extruded to specific heigths. the height numbers are given as a text object in the center of each one of the blocks in the floorplan...

 

Hoping I could use grasshopper to save some time, but it might be a job for rhino script maybe. Any help on this would be greatly appreciated.

 

Thanks!

 

Cheers,

 

  • up

    Andrew Heumann

    Here's a grasshopper script that will get text dot objects from rhino and return their contents and location.

     

    If what you have are 3d text objects, you'll need to figure out a way to convert them to dots (I think this is also rhinoscriptable - see here for the reverse process: http://wiki.mcneel.com/developer/scriptsamples/convertdotstotext)

     

    Hope this helps....

     

     

    • up

      Andrew Heumann

      and here's a rhinoscript that will convert your text objects to dots:

       

       

      Option Explicit

      Call Main()

      Sub Main()

       Dim arrObjects, strObject arrObjects = Rhino.AllObjects

       If IsArray(arrObjects) Then

      For Each strObject In arrObjects

      If Rhino.IsText(strObject)

      Then Rhino.SelectObject strObject

      Dim txtText, txtPt

      txtText = Rhino.TextObjectText(strObject)

      txtPt = Rhino.TextObjectPoint(strObject)

      Rhino.AddTextDot txtText,txtPt 

      Rhino.DeleteObject (strObject)

      End If

      Next

      End If

      End Sub

      1