+ Reply to Thread
Results 1 to 8 of 8

Thread: Return of rs.GetRectangle?

  1. #1
    Super Moderator Mitch's Avatar
    Join Date
    May 2010
    Location
    Switzerland
    Posts
    285

    Return of rs.GetRectangle?

    From the help:

    Returns: Tuple
    A tuple of four 3-D points that define the corners of the rectangle if successful. Points are returned in counter-clockwise order. See the image below for details.

    If I look at this in the debugger, this looks different than an ordinary point list (see images)

    What is this Rhino.Geometry.Point3d[]? It is what Rhino.Input.RhinoGet.GetRectangle returns, but I don't know what kind of object this is... Shouldn't this just be a tuple or a list?

    There is no problem referencing the items in the list or whatever it is, I just want to understand...

    --Mitch
    Attached Images

  2. #2
    Try the command:
    print(type("the thing you want to know"))
    It shows tuple on my computer.
    Last edited by maniux; 07-05-2012 at 03:31 PM. Reason: adding result.

  3. #3
    Super Moderator Mitch's Avatar
    Join Date
    May 2010
    Location
    Switzerland
    Posts
    285
    I get this:
    <type 'Array[Point3d]'>

    --Mitch

  4. #4
    the code:
    Quote Originally Posted by maniux View Post
    example = Rhino.Input.RhinoGet.GetRectangle()
    print (type(example))
    still the same result?
    Last edited by maniux; 07-05-2012 at 08:07 PM. Reason: ^

  5. #5
    Super Moderator Mitch's Avatar
    Join Date
    May 2010
    Location
    Switzerland
    Posts
    285
    Nope... see attached...
    Attached Images

  6. #6
    Quote Originally Posted by Mitch View Post
    Nope... see attached...
    I'm not sure... python does not have "array" type. It might be just a series of point3d but not in a list.
    I think this shows the difference of the two functions. For why it is like this, you need to read the code of the function to see the return values of the two function.

  7. #7
    Super Moderator Mitch's Avatar
    Join Date
    May 2010
    Location
    Switzerland
    Posts
    285
    I'm not sure... python does not have "array" type.
    It does, actually - although I'm not sure how much it's used. http://docs.python.org/library/array.html

    For why it is like this, you need to read the code of the function to see the return values of the two function
    I did, and as far as I can tell, rs.GetRectangle just calls Rhino.Input.RhinoGet.GetRectangle(), so the two should return the same thing. Mystery as to why it doesn't.

    --Mitch

  8. #8
    Quote Originally Posted by Mitch View Post
    It does, actually - although I'm not sure how much it's used. http://docs.python.org/library/array.html
    Oh, thanks for telling.
    Quote Originally Posted by Mitch View Post
    I did, and as far as I can tell, rs.GetRectangle just calls Rhino.Input.RhinoGet.GetRectangle(), so the two should return the same thing. Mystery as to why it doesn't.

    --Mitch
    Perhaps you can submit an issue on the developing page of rhino.python to the developers.

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts