整合自定义控件

This commit is contained in:
GG Z
2025-08-12 23:08:54 +08:00
parent f209e7d3ad
commit d0cfc64450
520 changed files with 30954 additions and 38968 deletions

View File

@@ -1,22 +1,20 @@
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Windows;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Nice3point.Revit.Toolkit.External;
using Nice3point.Revit.Toolkit.Utils;
using ShrlAlgoToolkit.Revit.Assists;
using ShrlAlgoToolkit.Revit.Extensions;
using System.Diagnostics;
using System.Text;
using System.Windows;
namespace ShrlAlgo.Addin.Test;
[Transaction(TransactionMode.Manual)]
@@ -118,6 +116,32 @@ internal class FluentAddin : ExternalCommand
}
public override void Execute()
{
var elementsBaseFace = Document.OfClass<FamilyInstance>().Where(
e => e is FamilyInstance ins &&
ins.Symbol.Family.FamilyPlacementType == FamilyPlacementType.WorkPlaneBased &&
ins.Host == null &&
ins.HostFace == null).ToList();
StringBuilder sb = new StringBuilder();
foreach (var elem in elementsBaseFace)
{
sb.AppendLine($"{elem.Id},{elem.Name}");
}
if (sb.Length > 0)
{
File.WriteAllText(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\MoveModel.csv", sb.ToString());
}
//UiDocument.Selection.SetElementIds(elementsBaseFace);
return;
//var dwg = Document.OfClass<ImportInstance>();
//UiDocument.Selection.SetElementIds(dwg.ToElementIds());
var refer = UiDocument.Selection.PickObject(Autodesk.Revit.UI.Selection.ObjectType.Element);
Document.Invoke(
ts =>
{
var elem = Document.GetElement(refer);
ElementTransformUtils.CopyElement(Document, elem.Id, XYZ.BasisY);
});
return;
FluentWindow fluentWindow = new FluentWindow();
fluentWindow.ShowDialog();
return;