Grasshopper

algorithmic modeling for Rhino

Hello.

I wrote some text in Rhino window and I would like to reference to it in Grasshopper. It doesn't seem to be obtainable with "String" component. Is there any way to do it ?

Views: 6285

Replies to This Discussion

The Horster Tools plugin has a ReadTxt component that reads all Rhino text objects to strings (you get their coordinates as well)

Alternatively you can create a scripting component to read the text property from the refferenced GUID:

refference the GUID the same way you refference geometry, put this code inside the VB.net component:

Dim obj As Rhino.DocObjects.TextObject
obj = Rhino.RhinoDoc.ActiveDoc.Objects.Find(x)
A = obj.DisplayText

thanks !

works great 

:)

by the way , the horster tools plugin didn't work for some reason...

Hi,

How to use this script in C#?

Dim obj As Rhino.DocObjects.TextObject
obj = Rhino.RhinoDoc.ActiveDoc.Objects.Find(x)
A = obj.DisplayText

Thanks,

Petras

private void RunScript(Guid x, ref object A)
{
Rhino.DocObjects.TextObject obj = default(Rhino.DocObjects.TextObject);
obj = (Rhino.DocObjects.TextObject) Rhino.RhinoDoc.ActiveDoc.Objects.Find(x);
A = obj.DisplayText;
}


Dim obj As Rhino.DocObjects.TextObject
obj = DirectCast(Rhino.RhinoDoc.ActiveDoc.Objects.Find(x), Rhino.DocObjects.TextObject)
A = obj.DisplayText

http://converter.telerik.com/

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service