Forgot password?

Create an account!

Forum

« back

RhinoScript – select (input) points and add sphere

Messages

Please log in to write a message.

  • 2. pulgarata (May 09, 2016 14.36):

    Hi,
    Here I modify you script. I just corrected a few things and it worked for me.

    Option Explicit
    'Script written by <insert name>
    'Script copyrighted by <insert company name>
    'Script version Sunday, 08 May 2016 16:21:06

    Call Main()
    Sub Main()        
            Dim arrPoints, arrPt
            arrPoints = Rhino.GetPointCoordinates()    
           
            If IsArray(arrPoints) Then
                    Dim strSphere, arrSphere
                   
                    For Each arrPt In arrPoints
                           
                            Rhino.Print Rhino.Pt2Str(arrPt)
                            strSphere = Rhino.AddSphere(arrPt, 2200)
                           
                            'If Rhino.IsSphere(strSphere) Then
                            '       arrSphere = Rhino.SurfaceSphere(strSphere)                             
                            'End If
                           
                    Next                      
                   
            End If
    End Sub

    Sebastian,

  • 1. youngjae (May 08, 2016 10.46):

    Hi I am totally new to Rhinoscript.

    For some reason my grasshopper sphere component is baking only some of the sphere I need so I decided to add spheres with rhinoscript using points that are already there.

    I just need a script that makes a user select points, and add spheres onto the points but I keep getting an error "Type mismatch in parameter. String Required."

    I don't know why but I need this script as soon as possible. any pointers#^^&%?

    Option Explicit
    'Script written by <insert name>
    'Script copyrighted by <insert company name>
    'Script version Sunday, 08 May 2016 16:21:06

    Call Main()
    Sub Main()
           
            Dim arrPoints, arrPt

            arrPoints = Rhino.GetPointCoordinates

           
            If IsArray(arrPoints) Then

                    For Each arrPt in arrPoints

                            Rhino.Print Rhino.Pt2Str(arrPt)

                    Next
                                                                   
                    Dim strSphere, arrSphere
                   
                    strSphere = Rhino.AddSphere(arrPoints, 2200)

                    If Rhino.IsSphere(strSphere) Then

                            arrSphere = Rhino.SurfaceSphere(strSphere)

                   

                    End If



            End If

           

    End Sub
Recommend

Why are these buttons gray?