44 lines
1.4 KiB
C#
44 lines
1.4 KiB
C#
|
|
using Autodesk.Revit.Attributes;
|
|||
|
|
using Autodesk.Revit.DB;
|
|||
|
|
|
|||
|
|
using Nice3point.Revit.Toolkit.External;
|
|||
|
|
|
|||
|
|
using System;
|
|||
|
|
|
|||
|
|
using Szmedi.RvKits.Assists;
|
|||
|
|
|
|||
|
|
namespace Szmedi.RvKits.Civil
|
|||
|
|
{
|
|||
|
|
[Transaction(TransactionMode.Manual)]
|
|||
|
|
|
|||
|
|
public class CreateStationOutlineCmd : ExternalCommand
|
|||
|
|
{
|
|||
|
|
public override void Execute()
|
|||
|
|
{
|
|||
|
|
string addInPath = typeof(RoomSettingViewModel).Assembly.Location;
|
|||
|
|
string dirRequestAssembly = Path.GetDirectoryName(addInPath);
|
|||
|
|
string dbString = $"Data Source={dirRequestAssembly}\\ArchiRoomData.db";
|
|||
|
|
DapperUtil dapperUtil = new(dbString);
|
|||
|
|
|
|||
|
|
//var roomReference = uidoc.Selection.PickObject(ObjectType.Element, new GenericFilter<Room>(),"请选择建筑轮廓区域");
|
|||
|
|
//Room room = doc.GetElement(roomReference) as Room;
|
|||
|
|
//var rommOulines = new FilteredElementCollector(doc).QueryElementsByType(typeof(Wall)).OfCategory(BuiltInCategory.OST_RoomSeparationLines).ToElements();
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
ArchiLayoutWin layoutWin = new(dapperUtil);
|
|||
|
|
dapperUtil.CreateConnect();
|
|||
|
|
layoutWin.ShowDialog();
|
|||
|
|
Document.Invoke(_ => { });
|
|||
|
|
|
|||
|
|
dapperUtil.CloseConnect();
|
|||
|
|
}
|
|||
|
|
catch (Exception)
|
|||
|
|
{
|
|||
|
|
dapperUtil.CloseConnect();
|
|||
|
|
throw;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|