已做出,该用法如下 调用函数 AcadCircle cl= op.CreateCircle(new double[] { 20, 20, 0 }, 10, "0", "ACAD_RED"); AcadEntity[] ens = new AcadEntity[1]; ens[0] = (AcadEntity)cl; double kk = op.GetVolume(ens, new double[3] { 0, 0, 0 }, new double[] { 1, 0, 0 }, 2 * Math.PI); 被调用函数,体积计算 public double GetVolume(AcadEntity[] entities, double[] axisPoint, double[] axisDir, double Angle) { double dv = 0; object[] regions = (object[])aDocument.ModelSpace.AddRegion(entities); AcadRegion region = (AcadRegion)regions[0]; Acad3DSolid sl = aDocument.ModelSpace.AddRevolvedSolid(region, axisPoint, axisDir, Angle); dv=sl.Volume; region.Delete(); sl.Delete(); return dv; } |