Forgot password?

Create an account!


« back

RhinoScript – Arch Scaling in Imperial Units


Please log in to write a message.

  • 3. Johannes (May 12, 2011 09.36):

    hi phil, take a look to the help file of rhinoscript. every function has a 'return'. the function Rhino.Command() returns just a true/false but you need the identifiers of the objects you want to scale.

    arrObjects = Rhino.AllObjects()


    ps: there are no 'silly questions'! feel free to ask our forum!

  • 2. bostonbeast (May 10, 2011 21.26):

    Nevermind guys figured it out! For some reason it wouldn't scale the objects that were selected using Rhino.Command "_SelAll"; so what I did was use Rhino.Command "_SelAll" by itself then set arrObjects = Rhino.SelectedObjects and it worked perfectly! It feels good to figure something out on your own. Sorry for all the silly questions; thanks and good luck!


  • 1. bostonbeast (May 10, 2011 02.22):

    I'm having a bit of trouble scripting a simply code to scale an object using imperial units (I live in the U.S. and am praying for the day we convert to metric, it is mush easier...). However, the code I have written does scale the objects at all, which is quite annoying because when i perform the same tasks manually it works fine. Thanks for your time.


    Const rhObjectPolysurface = 16
            Dim arrObjects00, arrObjects01, arrOrigin, arrScale

            arrObjects00 = Rhino.Command ("_SelAll", rhObjectPolysurface)
            'selects all polysurface objects in the file
            arrScale = Rhino.RealBox ("Enter Desired Scale of the Model")
            'asks the user for the scale
            If IsArray(arrObjects00) Then
                    arrOrigin = array(0,0,0)
                    If  IsArray(arrOrigin) Then
                            arrObjects01 = Rhino.ScaleObjects (arrObjects00, arrOrigin, array((.0833),(.0833),(.0833)), False)
                            'first scales the object to 1"=1'
                            If IsArray(arrObjects01) Then
                                    arrOrigin = array(0,0,0)
                                    If IsArray(arrOrigin) Then
                                            Rhino.ScaleObjects arrObjects01, arrOrigin, array(arrScale,arrScale,arrScale), False
                                            'then rescales that object to the desired scale
                                    End If
                            End If
                    End If
            End If

Why are these buttons gray?