Forgot password?

Create an account!


« back

RhinoScript – Array of numbers


Please log in to write a message.

  • 5. Johannes (Nov 17, 2010 11.43):


    Duplicates the edge curves of a surface or polysurface. For more information, see the Rhino help file for information on the DupEdge command.

    Rhino.DuplicateEdgeCurves (strObject [, blnSelect])

    An array of strings identifying the newly created curve objects if successful.

  • 4. Spendlik (Nov 17, 2010 11.36):

    I know that this is really stupid question but:

    Is it possible to select edge of a surface? I am trying to find something like Rhino.GetEdge or Rhino.GetObject("string",number that will allow you to select only edge).
    Is there something like that?

  • 3. Spendlik (Nov 02, 2010 08.35):

    Thank you Hanno. It works perfectly.
    Regarding the second thing - great idea, I will try it.
    Thank you again.


  • 2. Hanno (Nov 01, 2010 17.33):


    for your first question:

    GetPoint returns NULL if the user cancels the operation. So you can do it like this:

        arrPoint = Rhino.GetPoint("Placement of number:")
        If Not isnull(Number) Then
            Rhino.AddText Number, arrPoint, FontSize
            Number = Number + 1
        End If
    Loop Until isnull(Number)

    and for your second question:

    What I would do is write a script that collects all relevant objects from the model. Just filter by layer or by color or whatever fits your needs. The correct order should be no problem, as you are sorting numbered text objects.
    If you run your array regeneration script after opening a model, you should be fine.

    Hope that helps!


  • 1. Spendlik (Nov 01, 2010 09.29):

    Hello to all,
    I am starting to learn RhinoScript and have a few questions. One of my hobies is paper modelling. When I am creating a paper model one of the last thing you have to do is assigned number to every part of the model. So I have created very simple RhinoScript - which adds ascending numbers as text objects:

    Sub Numbering
      Dim Number
      Dim FontSize
      Dim arrPoint
      FontSize = Rhino.GetReal("Font Size:",5)
      Number = Rhino.GetReal("Start with:",1)
      Do Until Number = -1
        arrPoint = Rhino.GetPoint("Placement of number:")
        Rhino.AddText Number, arrPoint, FontSize
        Number = Number + 1
    End Sub

    I would like to loop of adding number as long as user wants. Is it possible with RhinoScript? My solution (number=-1) is really stupid and after right mouse click (to terminate the script) message error box appears (no array assigned to Rhino.GetPoint). So, how to create a loop which will run till the user terminate it?

    My second question is more theoretical - is it possible to create script which will create array of numbers with possibility to modify it in the future (after closing of Rhino)? For example I would like to add another part to a model, which should have number (e.q. 25), which is already assigned to another part. So I will raise number 25 to 26 (to make number 25 "free to use" for the new part) and all the rest bigger number will be raised by 1. Is this possible with RhinoScript - to save information about array into Rhino model?


Why are these buttons gray?