Getting geometrybase from guid in VB script?

Sorry…I must be tired or really dumb…but just can’t seam to find how to do this basic procedure.
Basically I have a surface GUID and want to extract it’s boundaries.
I guess I need to use Surface.ToBrep and then Brep.Edges but… I do I get the Surface instance from the GUID??

Hi @ruisantosfortes,

I’m confused. You mention GeometryBase, which is RhinoCommon, and VB script (which I assume means RhinoScript) which does not use RhinoCommon.

So what exactly are you using and trying to do? Do you have sample code that doesn’t work?

– Dale

Try DuplicateSurfaceBorder or DuplicateEdgeCurves? (works either in VB or Python)

ah…ok. Sorry. I always think RhinoScript bindings are closer than they are and get confused by the “vb” tab in rhinocommon reference.
So, just to avoid even trying something similar again…
In rhinoscript you only interact with existing objects via functions that take GUID as argument right?
Is this true for python also with all the coerce methods?

Thanks.

PS: By the way…will javascript be used as scripting in the future?

Also…

I’m doing a simple script to explode a polysurface, extract boundaries from the surfaces, simplify them, retrim the surfaces and join them all together again.

All this because the sweep command for a very simple rectangular frame with square section creates 3 degree boundaries and when meshing it creates a lot of extra faces.

Is there a way to simplify polysurfaces composed of planar surfaces?

Mostly true, yes.

The ‘coerce’ methods attempt to get a specific RhinoCommon object from a variety of possible inputs - including GUIDs. For example coerce3dpoint will return a RhinoCommon Point3d object if the input argument is one of the folllowing:

  • a GUID of a point object in a Rhino document
  • a RhinoCommon Vector3d object
  • a list of 3 numbers
  • a string in the format of "x,y,z" (where x, y and z are numeric).

If you are looking to get a geometrybase object, you could try coercegeometry, which will get you the base geometry from a GUID or an ObjRef.

Note also that the coerce… methods are pass-through if the input object is already the type of object being asked for.