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