Forgot password?

Create an account!


« back

RhinoScript – Name line object and select them afterwards


Please log in to write a message.

  • 2. Hanno (Apr 04, 2009 11.44):


    your objectname line seems right. If your variables are defined, you should get a name like "kmkgX_Y" (maybe there is a typo: you wrote "segEmentcounter").

    Later you can use ObjectsByName to select your lines by name.

    But generally I wouldn't use names to keep track of your objects, because you need to select them one by one. A better way is to directly save the curve ids (your buildLines function returns them anyway). Ideally you could save each id directly in the adequate array. This way you don't have to collect your lines later again but can use the array directly to loft.

    You can still give names to aour curves for debugging reasons (so you can identify them manually), though.



  • 1. pixelcrash (Apr 01, 2009 18.12):


    I am currently working on the File Loader from Roland Snooks from

    I can already import everything and also draw everything. the Problem I am facing now is to name the created Lines and Select them afterwards.

    my file contains X/Y/Z X1/Y1/Z1 coordinates - which will create a line
    here the code with some comments

    Function  buildLines(strLine)
    Dim arrPoint1, arrPoint2, line, arrTokens, strObject

    arrTokens = Rhino.Strtok(strLine)

    ' convert the first string to a 3D point
    arrPoint1 = Rhino.Str2Pt(arrTokens(0))
    arrPoint2 = Rhino.Str2Pt(arrTokens(1))

    ' Add a line to Rhino
    line = Rhino.AddLine(arrPoint1, arrPoint2)  
     kmkgcounter = kmkgcounter + 1
    buildLines = line
    ' here i want to name the lines with a counter and a linecounter
    ' the line and segment counter have been defined
    Rhino.ObjectName line, "kmkg" & CStr(linecounter)& "_" & CStr(segementcounter)

    'this doesnt work - because I might be totally wrong on my approach
    End Function

    in the end i would like to have something like this
    line_1_1 line_1_2 line_1_3 .... line_100_1 line_1_100

    Then I want to select all the line_1_* and loft them
    and then the line_2_* and loft them

    I hope this is clear in someway

    I am totally new to VB (had in school 10 years ago)

    thankfull for any help



Why are these buttons gray?