"gotocenter " help

good evening,

Thank you for the time you will devote to me, and especially sorry for my approximate English.

I made a “gotocenter” script.
It works but it is unfortunately not what I want, I explain:

picture 1:


Here is the starting point for my curves.

picture 2:


Here is the result of my script

picture 3:


Here is what I would like to get.

For information of grouping or not the curves do not change anything.
But I don’t want to go in this direction.

Thanks a lot for your answers.

Patrick

Hi Partick - have the script find the To and From points, and create a vector from these points, then usse that to move all the objects. Are you using Python/RhinoscriptSynatax, or? I think there is a rhinoscriptsyntax function that moves multiple objects on one vector simultaneously.

Moves one or more objects
    Parameters:
      object_ids ([guid, ...]): The identifiers objects to move
      translation (vector): list of 3 numbers or Vector3d
    Returns:
      list(guid, ...): identifiers of the moved objects if successful
    Example:
      import rhinoscriptsyntax as rs
      ids = rs.GetObjects("Select objects to move")
      if ids:
          start = rs.GetPoint("Point to move from")
          if start:
              end = rs.GetPoint("Point to move to")
              if end:
                  translation = end-start
                  rs.MoveObjects( ids, translation )
    See Also:
      MoveObject

-Pascal

Thank you for your answer .
The script I used is a script I found.
So I’m new to the subject.
I think I use python.

Patrick

Hello again Pascal,

Sorry but I don’t have scripting knowledge and it might be a bit difficult for me to use this rhinoscriptsyntax function. By any chance do you know how I can achieve this operations (move all selected objects to the center) in a simpler way ? Thanks for your help.

Hi Patrick -

You could simply use the Rhino BoxEdit command to achieve the goal that you described in your pictures.
-wim

You can also try this script. Save on your HD and drag-and-drop into Rhino vport

MoveSelectedToCenter().rvb (474 Bytes)

Now you should have this command/alias autocomplete:
MoveSelectedToCenter
and can add this to button, macro or keyboard shortcut. It should keep your grouping. It is simply using the center of the selection’s bounding box.