多项功能优化

This commit is contained in:
GG Z
2024-12-22 10:26:12 +08:00
parent 77655c9ef5
commit 83b846f15f
66 changed files with 5424 additions and 2927 deletions

View File

@@ -28,23 +28,22 @@ internal class CorrectSlope : ExternalCommand
var elem = Document.GetElement(id);
if (elem is MEPCurve mep)
{
var loc = mep.GetLocCurve() as Line;
var x = loc.Direction.X;
var y = loc.Direction.Y;
var z = loc.Direction.Z;
if (Math.Abs(loc.Direction.X) > 0 && Math.Abs(loc.Direction.X) < 10E-5)
{
x = 0;
}
if (Math.Abs(loc.Direction.Y) > 0 && Math.Abs(loc.Direction.Y) < 10E-5)
{
y = 0;
}
if (Math.Abs(loc.Direction.Z) > 0 && Math.Abs(loc.Direction.Z) < 10E-5)
{
z = 0;
}
var loc = mep.GetCurve() as Line;
var x = Math.Round(loc.Direction.X);
var y = Math.Round(loc.Direction.Y);
var z = Math.Round(loc.Direction.Z);
//if (Math.Abs(x) < 10E-5)
//{
// x = 0;
//}
//if (Math.Abs(y) < 10E-5)
//{
// y = 0;
//}
//if (Math.Abs(z) < 10E-5)
//{
// z = 0;
//}
var dir = new XYZ(x, y, z);
var endPoint = loc.Origin + dir * loc.Length;
var li = Line.CreateBound(loc.Origin, endPoint);