Forgot password?

Create an account!

Forum

« back

General – How to Import XY data TXT tables to Rhino by general icons?

Messages

Please log in to write a message.

  • 4. ledisnomad (Sep 12, 2011 14.36):

    Nice. Glad you found a way to make it work. Very simple.

  • 3. Arrow.111 (Sep 10, 2011 23.18):

    Hi dear Mr.Sidel

    I had found in Rhino its native way to import XY coordinates without having any number of coordinates restriction.
    See attached video link
    www.youtube.com/watch?v=FVXU6bfkp0I
    Thanks for help and suport!
    Truly
    Rob

  • 2. ledisnomad (Sep 09, 2011 18.25):

    I think you'll need a script... Here's one that sort of works but could use some refinement:

    Option Explicit
    'Script written by Damon Sidel
    'Script copyrighted by Damon Sidel
    'Script version Friday, September 09, 2011

    'NOTE: This script reads points from a txt file formatted as x and y values
    'in two columns separated by a few spaces.
    '0.12345678  0.12345678
    'It only works if there are exactly 10 characters for each value (10 on the
    'left for the x value and 10 on the right for the y value.
    'The z value is assumed to be 0.

    Call PointsFromFile()
    Sub PointsFromFile()
           
            Dim objFSO
            Set objFSO = CreateObject("Scripting.FileSystemObject")
           
            Dim objFile
            Set objFile = objFSO.OpenTextFile("H:\test.txt", ForReading)
           
            Const ForReading = 1
           
            Dim arrFileLines(), i
            i=0
            Do Until objFile.AtEndOfStream
                    ReDim Preserve arrFileLines(i)
                   
                    arrFileLines(i) = objFile.ReadLine
                    i=i+1
            Loop
                   
            Call objFile.Close()
           
            Dim strLine, x, y, j, arrPoints()
            j = 0
            For Each strLine In arrFileLines
                   
                    x = CDbl(Left(strLine,10))
                    y = CDbl(Right(strLine,10))
                   
                    ReDim Preserve arrPoints(j)
                    arrPoints(j) = Array(x, y, 0)
                   
                    j=j+1
                   
            Next
           
            Call Rhino.AddInterpCurve(arrPoints)

    End Sub
  • 1. Arrow.111 (Sep 09, 2011 13.29):

    Hi,
    How it is possible to Import XY data TXT tables of airfoil to Rhino and then connect them all by arc or curve lines?
    Preferably to use Rhino builtin functional icons.
    Thanks in advance for help
    Below example part of airfoil coordinates data.
    1.00000000 0.00000000
    0.99137155 0.54592114
    0.98325832 0.54468792
    0.97514509 0.54345471
    0.96703186 0.54222150
    0.95891864 0.54098829
    0.95080541 0.53975508
    0.94269218 0.53852187
    0.93457895 0.53728866
    0.92646572 0.53605544
    0.91835249 0.53482223
    0.91023927 0.53358902
    0.90212604 0.53235581
    0.89401281 0.53112260
    0.88589958 0.52988939
    0.87778635 0.52865618
    0.86967312 0.52742296
    0.86155989 0.52618975
    0.85344667 0.52495654
    0.84533344 0.52372333
    0.83722021 0.52249012
    0.82910698 0.52125691
    0.82099375 0.52002370
    0.81288052 0.51879048
    0.80476729 0.51755727
    0.79665407 0.51632406
    0.78854084 0.51509085
    0.78042761 0.51385764
    0.77231438 0.51262443
    0.76420115 0.51139121
    0.75608792 0.51015800
    0.74798764 0.50885655
    0.73998656 0.50703230
    0.73198547 0.50520805
    0.72398438 0.50338381
    0.71598329 0.50155956
    0.70798220 0.49973531
    0.69998112 0.49791106
    0.69198003 0.49608682
    0.68397894 0.49426257
    0.67597785 0.49243832
    0.66797677 0.49061407
    0.65997568 0.48878982
    0.65197459 0.48696558
    0.64397350 0.48514133
    0.63597241 0.48331708
    0.62797133 0.48149283
    0.61997024 0.47966858
    0.61196915 0.47784434
    0.60396806 0.47602009

Recommend

Why are these buttons gray?