Forgot password?

Create an account!

Forum

« back

RhinoScript – How to get selected object's points

Messages

Please log in to write a message.

  • 4. jmuneram (Aug 28, 2015 21.45):

    Dim arrEndPoints, strEndPoint ,strStartPoint, arrEndPoint


    Rhino.Command "'_SelPt"

    arrEndPoints = Rhino.GetObjects("Select Objects",,True,True)
    If Not IsArray(arrEndPoints) Then Exit Sub

    For Each strEndPoint In arrEndPoints

    arrEndPoint = Rhino.PointCoordinates(strEndPoint)
    Rhino.Print Rhino.Pt2Str(arrEndPoint)

    Next

  • 3. mayur.vadher (Aug 08, 2015 15.44):

    hi, thanks for reply.
    i want to create plugin in c#.net.
    the plugins is about to attach new object on every points of already selected object.
    i could manage to get object's points by this code :

    List<Point3d> pts= new List<Point3d>();
    RhinoObject obj = GetRhinoObject();
    foreach (Mesh ms in obj.GetMeshes(MeshType.Any))
    {
    pts.AddRange(ms.Vertices.ToPoint3dArray());

    }

    public RhinoObject GetRhinoObject()
    {
    RhinoObject obj;
    GetObject objAction = new GetObject();
    objAction.SetCommandPrompt("Please select any object");
    if (objAction.Get() != GetResult.Object)
    {
    RhinoApp.WriteLine("No object selected.");
    objAction.CommandResult();
    }
    Rhino.DocObjects.ObjRef objR = objAction.Object(0);
    obj = objR.Object();
    return obj;
    }

    Now, i want to draw a cone type object like pentagon by starting from each points to ending at the surface (i.e. z-axis is zero)
    And that new pentagon object should be the part of the original selected object.

    I hope you understand my problem.
    Please help me.

    Thanks & Regards,
    Mayur Vadher.

  • 2. chottabhai (Aug 08, 2015 14.36):

    hi.

    didn't get what you are trying to say, are you meaning that you want to get an array of points into the memory for use / manipulation in scripting? or get the surface points?

    there are a lot of routines for selecting / getting points, try going through the help file..

  • 1. mayur.vadher (Aug 06, 2015 07.35):

    I want to get all the points of selected object in my rhino plugins project in C#.Net or VB.Net.
    its better if i get points near surface.
    Any example or any portion of code in c# or vb.net could help me lot.
    Thanks.

Recommend

Why are these buttons gray?