Possible returns from rs.coercegeometry

Hello all,

I’ve inherited some ghPython code which is being used to convert a number of different geometry types to meshes. Right at the start of the code there’s a call to “rs.coercegeometry”. After some poking around, it looks like the documentation for the rs.coerceX functions hasn’t been published yet. This leaves me in a slightly uncomfortable position - I’ve got a big black box right at the start of a piece of code which I’m refactoring, and only the vaguest idea of what it does.

This is obviously a problem - I can’t write a robust piece of software unless I understand what these functions do and how they might fail. Is there a plan to publish the documentation sometime soon?

I was wondering in the meantime if I might be able to either look at the source code, or get a list of the possible returns of this function?


Hi Tj,

The way I scrutinize these methods is by running a dummy script with a breakpoint in the scripteditor:

This debugger stops here and once you step in you get to the method:

Nothe the oath to the library where all of rhinoscriptsyntax scripts reside


That’s ideal - thanks very much!

In GHPython world you can set a typehint for how input parameters are to pass along data, negating the whole guid/coercing business all together. In your case, either set to Mesh or No Type Hint:

Which means that your type is now a RhinoCommon Mesh: