Cage Edit or Interpolated points control in Rhino Script


#1

Hello all,
Any ideas on how to simulate Cage Edit in Rhino Script?
I would also need to have access to curve points (not Control Points) when coding in Rhino.
Thanks In advance


(Brian James) #2

@dale can you help here?


(Dale Fugier) #3

Cage editing is really just grip editing of a Cage object. RhinoScript supports this:

http://4.rhino3d.com/5/rhinoscript/object_grip_methods/object_grip_methods.htm

You can certainly get a curve’s “edit” points:

http://4.rhino3d.com/5/rhinoscript/curve_methods/curveeditpoints.htm

For polylines, you can obtain their vertices (too):

http://4.rhino3d.com/5/rhinoscript/curve_methods/polylinevertices.htm

Not sure what else you are looking for…

– Dale


#4

@dale
Thanks for providing the links
However as I went through:

http://4.rhino3d.com/5/rhinoscript/object_grip_methods/object_grip_methods.htm

I could not find anything similar to CageEdit that takes captive object(s) with control objects like:
Bounding box, Line, Rectangle, Box
and the deformation option (Fast/Accurate)
Could you please make an example accordingly?


(Dale Fugier) #5

Hi Vahab,

Not every Rhino command is implemented as a RhinoScript method. And that is OK because RhinoScript is designed to augment Rhino’s command line scripting. Thus, it is very common, and often necessary, to script Rhino commands within your RhinoScript subroutines.

In this case, you will want to script the CageEdit command using RhinoScript’s Command method.

Does this help?

– Dale


#6

@dale
Hi Dale,
Thanks for the note,
I can certainly do Rhino.Command("CageEdit")
What I do not know is whether or not I can append the options to the command; like this:
Rhino.Command("CageEdit" & controlobject = BoundingBox & CordinateSytem = World & Cagepoints = XPointCouint :4, YPointCouint :4 ...)


#7
Call Rhino.UnselectAllObjects()
Call Rhino.SelectObject(strYourId)
Call Rhino.Command("!-_CageEdit BoundingBox World _XPointCount=2 _YPointCount=2 _ZPointCount=2 _Enter Global _Enter")
Dim newObjs
newObjs = Rhino.LastCreatedObjects()

and then check and do something with newObjs. … did not test the code, but it should give a startpoint. the underscore is for the script to run on another language…

do a command first by typing everything in the commandline remember every space " " and every Return “_enter” then step by step bring it to a string that works.

good luck

by the way - is cage-edit accessible via rhinocommon ?


#9

Thanks,
Yeah the code is working,


#10

No, but you could access cage grips and setup the relationship using command scripting.

c.