Forgot password?

Create an account!


« back

RhinoScript – Select Objects By Id


Please log in to write a message.

  • 12. gonzago (Jul 26, 2011 20.55):

    i done it i'd just put it like these for i = 0 to (a)
    a is the variable

  • 11. gonzago (Jul 26, 2011 20.50):

    thanks a lot people like you make forums work
    other question. I want to pick the numbers of division by rhino getinteger, and put it into a variable. But then when when i put for i = 0 to 'variable' it will be an error for that procedment ask me for an integer.

  • 10. gonzago (Jul 26, 2011 20.31):

    thanks a lot people like you make forums work

  • 9. Johannes (Jul 24, 2011 22.00):

    hi, just an info about points. there are 2 types of them... the first one represents a point with x,y,z coodinates. that is just an array with 3d-point informations (ex. result of dividing a curve). the second one is an rhino object with an identifier ('name') and its properties containing the x,y,z coordinates.

    dim p1  : p1 = array(10,0,0)        'point coordinates
    dim p2  : p2 = Rhino.AddPoint(p1)   'rhino object

    dim arrCoord  : arrCoord = Rhino.PointCoordinates(p2)  'coordinates of a point

    here an example to divide two crvs and add some lines between them:

            Dim lineA       : lineA = Rhino.GetObject("pick line A")
            Dim lineB       : lineB = Rhino.GetObject("pick line B")
            Dim arrPA       : arrPA = Rhino.DivideCurve(lineA, 5, False)
            Dim arrPB       : arrPB = Rhino.DivideCurve(lineB, 5, False)
            Dim i
            For i = 0 To 5
                    Call Rhino.AddLine(arrPA(i), arrPB(i))

  • 8. gonzago (Jul 22, 2011 18.15):

    hi i'm new in this. I,m wondering how can i do to take the points recently done from a division on two curves and make lines taking as start points the point in one of the curves and the end points in the other curve.
    i'd try with the "for each in" and the addline function but it doesn't work.
    i will apreciate some help.

  • 7. pool338 (Jul 14, 2011 10.48):

    Thank You Hanno,
    you was really helpfull.

    I was able to set the materialcolor to an object as expected, but the newly setted color is not taken in rederer. The rendered object is always grey, what the default rhino render color is, i assume.

  • 6. Hanno (Jul 14, 2011 10.14):

    For renderings, you have to assign your objects materials. If your objects should have individual colors, try using AddMaterialToObject and then MaterialColor. Have a look at the "material methods" section in the Rhinoscritp help.


  • 5. pool338 (Jul 14, 2011 10.06):

    I just tried it and it worked as expected.

    One question is still unanswered:
    Rhino.ObjectColor sets the color of an Object, but when i render the object, the color is still missing. What do i have to do, to set the render color?

  • 4. Hanno (Jul 14, 2011 09.46):

    Ok, I thought you were just command scripting.
    In rhinoscript, the object ID is the object, so you can use it like this:

    Rhino.ObjectColor(myObjectId, someColor)


  • 3. pool338 (Jul 14, 2011 09.40):

    Thank you for reply. I already knew the command _SelId, but this doesnt give me the object, it just selects it. (Ok, its my fault, i dindt explain correctly).

    What i need is a way to set (for example) the color of an object, but i just have the objectid.
    I found the command Rhino.ObjectColor, which requires an Object.

  • 2. Hanno (Jul 14, 2011 09.34):

    _SelId is what you are looking for.

  • 1. pool338 (Jul 14, 2011 09.31):


    im trying to select objects by the generated ids, but didnt find the command. Can anyone help me please.

    I use _Explode to "explode" a blockinstance and want to select the generated smaller instances by id. I cant use SelectByName because they all have the same name.



Why are these buttons gray?