My issue is the following:
I wish to copy paste an object from a file to another or from layout to model space.
At this point, the pasted object will be placed at the same location as it is in the other file (unknown yet to me when it is from layout to model space).
Question/wish - is it possible to have the option of choosing the displacement for the object? I am referring to have the object “sticked” to the mouse pointer.
It is very useful to copy/paste in the same location.
But it is also useful (in many cases) when copy/paste to have the selection (the object) right next to the mouse pointer. Thus I can place the copied object wherever I want, without searching it through the model.
I am asking this because I have very big drawings or models. When I am copying something from a different file, or from layout to the model space, I always have to make zoom/select then make a move command, then zoom/extend and then zoom to where I want to place it.
Can you please implement this in the future version? (I do not know if it is something already in the v5… )
The standard reply to this wish is to make a paste&move macro. You might want to throw in a zoom extend (or selected) and zoom previous around the move-from prompt.
I already made that, but I do not know how to make the objects to be selected automatically, without clicking the mouse.
At this moment, the macro is pasting and zooming, but I still have to click the mouse to select an insertion point. I need to pass this, so the selection is made without actual clicking…
This is not logical. To move an object precisely in 3D space, you need a “from” point and a “to” point. Otherwise your move is still going to be arbitrary.
Yup. That is why I like the idea of wim:
I have the objects selected. It should be something that will make a bounding box and pick the centroid of it.
I think a command that allows you to pick both the copy from point on the object and the insertion point for the paste would be more useful, as the object’s bounding box center is not always a useful reference. --Mitch
Perhaps what you are looking to add to your makro after the paste is just a
SelLast
_Zoom _Selected
Move 0,0,0 Pause
? Asuming the pasted parts are near origin…Michael VS
**First script**
Option Explicit
'Script written by xiaoyazi
'Script copyrighted by SMC2
'Script version mercredi 26 septembre 2012 18:36:48
'copier des objects avec l'origine
Call Main()
Sub Main()
Dim objects,point,Shell,pt2
objects = Rhino.SelectedObjects' si il n'y as pas d'objecs dasn la selection,
If isnull(objects) Then
objects = rhino.GetObjects("selectionner les objects à copier")
If isnull(objects) Then
Exit Sub
End If
End If
point = rhino.GetPoint("selectionner le point d'origine")
If isnull(point) Then
Exit Sub
End If
rhino.EnableRedraw False
rhino.SelectObjects objects
rhino.command("!_CopyToClipboard")
rhino.EnableRedraw True
Set Shell = CreateObject("WScript.Shell")
Shell.RegWrite "HKEY_CURRENT_USER\Software\x", point(0), "REG_SZ"
Shell.RegWrite "HKEY_CURRENT_USER\Software\y", point(1), "REG_SZ"
Shell.RegWrite "HKEY_CURRENT_USER\Software\z", point(2), "REG_SZ"
End Sub
**Second script**
Option Explicit
'Script written by xiaoyazi
'Script copyrighted by SMC2
'Script version jeudi 27 septembre 2012 13:34:08
Call Main()
Sub Main()
Dim Shell, x,y,z,objects,point,verif,a ,x2,y2,z2
Set Shell = CreateObject("WScript.Shell")
x = Shell.RegRead("HKEY_CURRENT_USER\Software\x")
y = Shell.RegRead("HKEY_CURRENT_USER\Software\y")
z = Shell.RegRead("HKEY_CURRENT_USER\Software\z")
'Exit Sub
point = rhino.GetPoint("selectionner le point d'insertion")
If isnull(point) Then
Exit Sub
End If
x2 = split(x, ",")
If ubound(x2) > 0 Then
x = x2(0) + "." + x2(1)
Else
x = x2(0)
End If
y2 = split(y, ",")
If ubound(y2) > 0 Then
y = y2(0) + "." + y2(1)
Else
y = y2(0)
End If
z2 = split(z, ",")
If ubound(z2) > 0 Then
z = z2(0) + "." + z2(1)
Else
z = z2(0)
End If
rhino.enableredraw False
rhino.Command " '_Paste"
objects = Rhino.SelectedObjects
verif = rhino.MoveObjects(objects, array(x, y, z), point)
rhino.enableredraw True
End Sub
I think autocad does this. If you copy an object and then paste, the object attach to cursor far left bottom position before you click to confirm where you want to paste. There’s also an option to choose copy base point before you copy. It could be really useful.