Quantcast
Channel: Grasshopper Developer - McNeel Forum
Viewing all articles
Browse latest Browse all 3655

Convert Text to ToString on Mac

$
0
0

@Roman_Gorshkov wrote:

Just trying to write a tool to cover flat set of text to create a list of points which elevation is based on text string.

Cant find a way to convert text object to string and to doubles for z values?
Also how can I check if the text is a number or a random text ?

I know there are lots of tools already, what to do it myself.

   List<Point3d> ptList = new List<Point3d>();
		double x;
		double y;
		double z;

    foreach(var guid in textID)
    {
      var text = Rhino.RhinoDoc.ActiveDoc.Objects.Find(guid) as Rhino.DocObjects.TextObject;
      if(text != null)
      {

x = text.TextGeometry.Plane.OriginX;
y = text.TextGeometry.Plane.OriginY;
z = Convert.ToDouble(ToString(text));

Point3d newPoint = new Point3d(x, y, z);
        ptList.Add(newPoint);
      }
    }
    points = ptList;

TextToPoint.3dm (3.6 MB) TextToPoint.gh (7.2 KB)

Posts: 16

Participants: 4

Read full topic


Viewing all articles
Browse latest Browse all 3655


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>