Thanks again MickD.
So using the Pipe's ECS still doesn't seem to position, or orientate, the text solid or the cylinder. Given this code:
using (Transaction tr = this.m_db.TransactionManager.StartTransaction())
{
try
{
BlockTableRecord btr = tr.GetObject(this.m_db.CurrentSpaceId, OpenMode.ForWrite) as BlockTableRecord;
ent.SetDatabaseDefaults();
// Extrude this region just beyond the thickness of the pipe...
var textSolid = new Solid3d { RecordHistory = true };
textSolid.Extrude(ent as Region, extrudeHeight, 0.0);
// Using ECS
Plane plane = new Plane(pipeEcs.CoordinateSystem3d.Origin, pipeEcs.CoordinateSystem3d.Xaxis, pipeEcs.CoordinateSystem3d.Yaxis);
Matrix3d matrix = Matrix3d.WorldToPlane(plane);
textSolid.TransformBy(matrix);
// Add this solid to the model...
btr.AppendEntity(textSolid);
tr.AddNewlyCreatedDBObject(textSolid, true);
// Create the cylinder that will be subtracted from the text regoin, and move it to the center point of the pipe..
var cyl = new Solid3d { RecordHistory = true };
var radius = (outsideDiameter / 2.0);
cyl.CreateFrustum(pipeLength, radius, radius, radius);
cyl.TransformBy(matrix);
btr.AppendEntity(cyl);
tr.AddNewlyCreatedDBObject(cyl, true);
}
catch
{
this.m_isValid = false;
}
finally
{
tr.Commit();
}
}
See screenshot - the pipe I clicked on is marked with the red arrow, and I put a box around where the text and cylinder ended up being positioned and oriented. Not sure what's going on here? Also note that I also tried creating the plane using the pipe's StartPoint as the first parameter as in your example, but that positioned the text solid and cylinder in a slightly different position as in the screenshot..
Is there something I missed when using this approach?