update installer
This commit is contained in:
parent
c52fcfc606
commit
ddc463824b
@ -18,6 +18,7 @@ using System.Runtime.InteropServices;
|
||||
using TriangleNet;
|
||||
using uBIMEarthTools.Utils;
|
||||
using uBIMEarthTools.Model;
|
||||
using System.Reflection;
|
||||
|
||||
namespace uBIMEarthTools.Commands
|
||||
{
|
||||
@ -61,11 +62,8 @@ namespace uBIMEarthTools.Commands
|
||||
if (!familys.Any())
|
||||
{
|
||||
transaction.Start("Load Family");
|
||||
byte[] bit = Resource.地质钻孔圆柱 as byte[];
|
||||
string filepath = AppConfig.APP_TEMP_PATH + "\\地质钻孔圆柱.rfa";
|
||||
File.WriteAllBytes(filepath, bit);
|
||||
string filepath = Directory.GetParent(Assembly.GetExecutingAssembly().Location) + "\\Family\\地质钻孔圆柱.rfa";
|
||||
doc.LoadFamily(filepath);
|
||||
File.Delete(filepath);
|
||||
transaction.Commit();
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,9 @@ using Autodesk.Revit.UI;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Windows.Forms;
|
||||
using uBIMEarthTools.Core;
|
||||
using uBIMEarthTools.Model;
|
||||
@ -123,18 +125,32 @@ namespace uBIMEarthTools.Commands
|
||||
Common.SetTransaction(transaction);
|
||||
|
||||
#region 创建钻孔标记
|
||||
transaction.Start("load the FamilySymbol");
|
||||
IEnumerable<FamilySymbol> familysymbols_bj = from elem in new FilteredElementCollector(doc).OfClass(typeof(FamilySymbol))
|
||||
let fstmp = elem as FamilySymbol
|
||||
where fstmp.Name.Contains("钻孔标记")
|
||||
select fstmp;
|
||||
if (!familysymbols_bj.Any())
|
||||
|
||||
IEnumerable<Element> familys = new FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_GenericModel).OfClass(typeof(FamilySymbol)).Where(x => x.Name == "钻孔标记");
|
||||
if (!familys.Any())
|
||||
{
|
||||
MessageBox.Show("请先加载配套的“钻孔标记”族。", "uBIM", MessageBoxButtons.OK);
|
||||
status = transGroup.Assimilate();
|
||||
return Result.Succeeded;
|
||||
transaction.Start("Load Family");
|
||||
string filepath = Directory.GetParent(Assembly.GetExecutingAssembly().Location) + "\\Family\\钻孔标记.rfa";
|
||||
doc.LoadFamily(filepath);
|
||||
transaction.Commit();
|
||||
}
|
||||
FamilySymbol fs_bj = doc.GetElement(familysymbols_bj.First().Id) as FamilySymbol;
|
||||
|
||||
transaction.Start("load the FamilySymbol");
|
||||
//IEnumerable<FamilySymbol> familysymbols_bj = from elem in new FilteredElementCollector(doc).OfClass(typeof(FamilySymbol))
|
||||
// let fstmp = elem as FamilySymbol
|
||||
// where fstmp.Name.Contains("钻孔标记")
|
||||
// select fstmp;
|
||||
//if (!familysymbols_bj.Any())
|
||||
//{
|
||||
// MessageBox.Show("请先加载配套的“钻孔标记”族。", "uBIM", MessageBoxButtons.OK);
|
||||
// status = transGroup.Assimilate();
|
||||
// return Result.Succeeded;
|
||||
//}
|
||||
//FamilySymbol fs_bj = doc.GetElement(familysymbols_bj.First().Id) as FamilySymbol;
|
||||
//fs_bj.Activate();
|
||||
var fs_bj = (new FilteredElementCollector(doc)
|
||||
.OfCategory(BuiltInCategory.OST_GenericModel).OfClass(typeof(FamilySymbol))
|
||||
.Where(x => x.Name == "钻孔标记").First() as FamilySymbol);
|
||||
fs_bj.Activate();
|
||||
transaction.Commit();
|
||||
|
||||
@ -237,8 +253,18 @@ namespace uBIMEarthTools.Commands
|
||||
#region 创建常规模型地质块
|
||||
using (FilterProgressForm prf1 = new FilterProgressForm("生成地质模型", "{0} of " + geologyBlocks.Count.ToString(), geologyBlocks.Count))
|
||||
{
|
||||
familys = new FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_GenericModel).OfClass(typeof(FamilySymbol)).Where(x => x.Name == "常规模型地质块");
|
||||
if (!familys.Any())
|
||||
{
|
||||
transaction.Start("Load Family");
|
||||
string filepath = Directory.GetParent(Assembly.GetExecutingAssembly().Location) + "\\Family\\常规模型地质块.rfa";
|
||||
doc.LoadFamily(filepath);
|
||||
transaction.Commit();
|
||||
}
|
||||
|
||||
Family family = (new FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_GenericModel)
|
||||
.OfClass(typeof(FamilySymbol)).First(x => x.Name == "常规模型地质块") as FamilySymbol).Family;
|
||||
|
||||
Autodesk.Revit.DB.Document fdoc = doc.EditFamily(family);
|
||||
Transaction trans = new Transaction(fdoc);
|
||||
trans.Start("Create FamilySymbol");
|
||||
|
@ -4,17 +4,19 @@
|
||||
<UseWPF>true</UseWPF>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Remove="Resource.Designer.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Remove="Resource.resx" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Remove="PackageContents.xml" />
|
||||
<None Remove="uBIMEarthTools.addin" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="PackageContents.xml">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="uBIMEarthTools.addin">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="EPPlus" Version="5.6.4" />
|
||||
@ -25,4 +27,18 @@
|
||||
<PackageReference Include="Triangle" Version="0.0.6-Beta3" />
|
||||
<PackageReference Include="uBIM.UI" Version="1.0.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Update="Family\地质钻孔圆柱.rfa">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Family\常规模型地质块.rfa">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Family\钻孔标记.rfa">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="uBIMEarthTools.addin">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
Loading…
Reference in New Issue
Block a user