多项功能优化
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user