I want to create the meshes of user-selected InstanceObjects
to perform Boolean operations with them afterwards. Neither in the editor GUI nor in the code I succeeded so far for the attached file twoBoxes_blocks.3dm (42.4 KB).
However, when I don’t create block definitions twoBoxes.3dm (45.6 KB), it works in the GUI. But in my case I need it to function with block definitions.
code:
/// C#
Rhino.DocObjects.ObjRef[] selection;
var rc = Rhino.Input.RhinoGet.GetMultipleObjects("message", false, ObjectType.InstanceReference, out selection);
var part1 = selection[0];
var part2 = selection[1];
part1.(MeshType.Analysis, new MeshingParameters(), false);
part2.(MeshType.Analysis, new MeshingParameters(), false);
var m1 = part1.Object().GetMeshes(AnalysisMesh); // returns Rhino.Geometry.Mesh[0]
var m2 = part2.Object().GetMeshes(AnalysisMesh); // returns Rhino.Geometry.Mesh[0]
var splits = Mesh.CreateBooleanSplit(m1, m2); // returns null
As an alternative to GetMeshes()
I tried without success also:
part1.Mesh(); // returns null
However, there has to be a mesh because
part1.Object().MeshCount(MeshType.Analysis, new MeshingParameters()); // returns 1
How can I access the meshes and perform the boolean operation?
System: Rhino for Mac 5.2.2