[CE U13.1 C#] How to work with Type 19 Solid in LocateSubEntityTool?


I am working on a tool designed for 3D operations with solid, where one from possible inputs can be old solid (element type 19).

I am aware of a fact that not ISolidKernelEntity (which I guess is also type 19) has limited support, but I was not able to implement any working code that would allow me to access the solid geometry.

The tools is "read only / query tool", so IsModifyOriginal returns true. I am not sure what is a right value returned from OnPreElementModify.

I am able to select the solid and its face(s), but I failed to do anything in OnElementModify:

public override StatusInt OnElementModify(Element element)
    SubEntity[] subEntities = new SubEntity[0];
    this.GetAcceptedSubEntities(ref subEntities);
    // Ok, I receive accepted faces

    for (int i = 0; i < subEntities.Length; i++)
        SubEntity face = subEntities[i];

        IntPtr geom = default(IntPtr);
        BentleyStatus getGeometryStatus = this.GetSubEntityGeometry(geom, face);
        // getGeometryStatus is SUCCESS, but the pointer is always zero ... no data

        SubEntity[] vertices;
        BentleyStatus getFaceVerticesStatus = SolidUtil.GetFaceVertices(out vertices, face);
        // getFaceVerticesStatus is always ERROR

    // Element is not modifed
    // From C++ documentation: ERROR to reject change or if change completely handled by tool.
    return StatusInt.Error;

I also tried to overwrite

protected override BentleyStatus OnProcessSolidPrimitive(ref SolidPrimitive geomPtr, DisplayPath path)
    return BentleyStatus.Error;

but the results are always the same regardless Error or Success is returned. It seems the method is never called, I was not able to reach a break point in Debug or to print a message from the method :-(

I would like to know whether I do anything wrong (e.g. to override some other method?) or there is a bug in the code (maybe two bugs? ... OnProcessSolidPrimitve not called and GetSubEntityGeometry returns success but not pointer?).

Ultimately, I need to obtain:

  • geometry (and vertices), when a user selects face
  • curve (and end points), when a user selects edge
  • point, when a user selects vertex

With regards,