多项功能优化

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

@@ -17,12 +17,12 @@ internal class AlignModelElement
//var viewPlane = Plane.CreateByNormalAndOrigin(ownerView is View3D ? XYZ.BasisZ : ownerView!.ViewDirection, ownerView.Origin);
var elementBBox = e.get_BoundingBox(ownerView);
var bounding = e.get_BoundingBox(ownerView);
var max = elementBBox.Max;
var min = elementBBox.Min;
//var globalMax = elementBBox.Max;
//var globalMin = elementBBox.Min;
var max = bounding.Max;
var min = bounding.Min;
//var globalMax = bounding.Max;
//var globalMin = bounding.Min;
//var distanceProjected = ProjectedDistance(viewPlane, globalMax, globalMin);
@@ -40,10 +40,12 @@ internal class AlignModelElement
//var max = ownerViewTransform.Inverse.OfPoint(globalMax); //Max in the coordinate space of the view
//var min = ownerViewTransform.Inverse.OfPoint(globalMin); //Min in the coordinate space of the view
UpLeft = new XYZ(Math.Min(min.X, max.X), Math.Max(max.Y, min.Y), 0);
UpRight = new XYZ(Math.Max(min.X, max.X), Math.Max(max.Y, min.Y), 0);
DownLeft = new XYZ(Math.Min(min.X, max.X), Math.Min(max.Y, min.Y), 0);
DownRight = new XYZ(Math.Max(min.X, max.X), Math.Min(max.Y, min.Y), 0);
Center = (UpRight + DownLeft) / 2;
Bottom = min.Z;
Top = max.Z;

View File

@@ -1,28 +0,0 @@
using Autodesk.Revit.DB;
namespace Sai.RvKits.RvCommon
{
internal class CustomLeader
{
public CustomLeader(Leader leader)
{
End = leader.End;
Elbow = leader.Elbow;
}
public CustomLeader()
{
End = new XYZ(0, 0, 0);
Elbow = new XYZ(0, 0, 0);
}
public CustomLeader(XYZ end, XYZ elbow)
{
End = end;
Elbow = elbow;
}
public XYZ End { get; set; }
public XYZ Elbow { get; set; }
}
}

View File

@@ -1,4 +1,8 @@
using Autodesk.Revit.Attributes;
using System.IO;
using System.Reflection;
using Autodesk.Revit.ApplicationServices;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using eTransmitForRevitDB;
@@ -28,12 +32,18 @@ public class PureModelCmd : ExternalCommand
OverwriteExistingFile = true,
MaximumBackups = 3
};
for (var i = 0; i < 5; i++)
try
{
Purge(Document);
Document.SaveAs(Document.PathName, options);
System.Windows.MessageBox.Show("清理完成", "提示");
}
Document.SaveAs(Document.PathName, options);
System.Windows.MessageBox.Show("清理完成", "提示");
catch (Exception)
{
throw;
}
}
/// <summary>
/// 使用eTransmitForRevitDB清理文档未使用项

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Autodesk.Revit.Attributes;
using Nice3point.Revit.Toolkit.External;
namespace Sai.RvKits.RvCommon;
[Transaction(TransactionMode.Manual)]
[Regeneration(RegenerationOption.Manual)]
internal class QuickSelectionCmd : ExternalCommand
{
public override void Execute()
{
throw new NotImplementedException();
}
}

View File

@@ -0,0 +1,15 @@
<Window
x:Class="Sai.RvKits.RvCommon.QuickSelectionView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Sai.RvKits.RvCommon"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="条件选择"
Width="800"
Height="450"
mc:Ignorable="d">
<Grid>
<GroupBox Header="选项" />
</Grid>
</Window>

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace Sai.RvKits.RvCommon;
/// <summary>
/// QuickSelectionView.xaml 的交互逻辑
/// </summary>
public partial class QuickSelectionView : Window
{
public QuickSelectionView()
{
InitializeComponent();
}
}