BCOM.Element CreatePileCrossSectionElement(IPileProperty pileprop) { //double uorpermaster = app.ActiveModelReference.UORsPerMasterUnit; BCOM.Matrix3d m = app.Matrix3dIdentity(); BCOM.Point3d centroidp = pileprop.PileTopPoint.Point3dToBCOMPoint3d(1e4 / uorpermaster); centroidp.Z = 0; // xy平面 double pilediameter = pileprop.PileDiameter * 1e4 / uorpermaster; int colorindex = 3; if ((pileprop is SquarePileGeometry) || (pileprop is SquarePileGeometry)) { BCOM.Point3d[] squarvertexs = { app.Point3dFromXY(pilediameter / 2, pilediameter / 2), app.Point3dFromXY(-pilediameter / 2, pilediameter / 2), app.Point3dFromXY(-pilediameter / 2, -pilediameter / 2), app.Point3dFromXY(pilediameter / 2, -pilediameter / 2) }; BCOM.ShapeElement shape = app.CreateShapeElement1(null, ref squarvertexs, BCOM.MsdFillMode.NotFilled); shape.Move(ref centroidp); shape.Color = colorindex; return(shape); } else { var c = app.CreateEllipseElement2(null, ref centroidp, pilediameter / 2, pilediameter / 2, ref m, BCOM.MsdFillMode.NotFilled); c.Color = colorindex; return(c); } }