Check the Brep.DuplicateVertices method.
In case you have an extrusion box, you might have to use the ToBrep method first before calling DuplicateVertices.
Hi Adrian
When trying to replicate a RhinoScript method by RhinoCommon,
looking at https://github.com/mcneel/rhinopython/tree/master/scripts/rhinoscript may help.
This the code written by Steve Baer that is used to replictae RhinoScript methods in IronPython.
(BTW in IronPython it’s called the rhinoscriptsyntax library)
Yes, it’s Python, not Vb.net, but the RhinoCommon objects and function used should also work in VB.
The same code should be found on the PC where Rhino is installed.
Here it is in
def GetBox(mode=0, base_point=None, prompt1=None, prompt2=None, prompt3=None):
"""Pauses for user input of a box
Parameters:
mode[opt] = The box selection mode.
0 = All modes
1 = Corner. The base rectangle is created by picking two corner points
2 = 3-Point. The base rectangle is created by picking three points
3 = Vertical. The base vertical rectangle is created by picking three points.
4 = Center. The base rectangle is created by picking a center point and a corner point
base_point[opt] = optional 3D base point
prompt1, prompt2, prompt3 [opt] = optional prompts to set
Returns:
list of eight Point3d that define the corners of the box on success
None is not successful, or on error
"""
base_point = rhutil.coerce3dpoint(base_point)
if base_point is None: base_point = Rhino.Geometry.Point3d.Unset
rc, box = Rhino.Input.RhinoGet.GetBox(mode, base_point, prompt1, prompt2, prompt3)
if rc==Rhino.Commands.Result.Success: return tuple(box.GetCorners())
Your post was clear. I simply forgot to read it and only looked at the title … sorry
But Djordje got it right, I’d follow his suggestion:
Brep.DuplicateVertices() will give you the points. It doesn.t ‘duplicate’ Rhino objects in the document, it just returns Point3d objects, which I think is what you need.
To get the Brep object, just use the Brep() method on the ObjRef object (the rhobj var loaded by GetOneObject() )
Awesome, thanks @emilio & @djordje (@dale also) for your perseverance, that has nailed it.
I think I am coming to grips with the way the SDK documentation is written, which is why I didn’t get it first time.