日常更新
This commit is contained in:
@@ -48,13 +48,18 @@ namespace RookieStation.Drawing.ExecuteCmd
|
|||||||
};
|
};
|
||||||
//房间边界
|
//房间边界
|
||||||
var boundingseg = room.GetBoundarySegments(options);
|
var boundingseg = room.GetBoundarySegments(options);
|
||||||
if (boundingseg.Count > 2)
|
//if (boundingseg.Count > 2)
|
||||||
|
//{
|
||||||
|
// TaskDialog.Show("提示", "目前仅支持独立单栋建筑形式。");
|
||||||
|
// return Result.Failed;
|
||||||
|
//}
|
||||||
|
var outerbounding = boundingseg.FirstOrDefault();
|
||||||
|
//最多条边的内部边界
|
||||||
|
segments = boundingseg.OrderByDescending(li => li.Count()).FirstOrDefault();
|
||||||
|
if (outerbounding == segments)//最多边的边界和最外围是同一个
|
||||||
{
|
{
|
||||||
TaskDialog.Show("提示", "目前仅支持独立单栋建筑形式。");
|
segments = boundingseg[2];
|
||||||
return Result.Failed;
|
|
||||||
}
|
}
|
||||||
//内部边界
|
|
||||||
segments = boundingseg.LastOrDefault();
|
|
||||||
foreach (BoundarySegment segment in segments)
|
foreach (BoundarySegment segment in segments)
|
||||||
{
|
{
|
||||||
var curve = segment.GetCurve() as Line;
|
var curve = segment.GetCurve() as Line;
|
||||||
@@ -81,7 +86,7 @@ namespace RookieStation.Drawing.ExecuteCmd
|
|||||||
doc.Invoke(ts =>
|
doc.Invoke(ts =>
|
||||||
{
|
{
|
||||||
CreateOuterWallsDimByReferLines(doc, dics);
|
CreateOuterWallsDimByReferLines(doc, dics);
|
||||||
List<Element> wallList = GetWallListToDim(doc);
|
List<Wall> wallList = GetWallListToDim(doc);
|
||||||
foreach (var outerwall in singleWallsToDim)
|
foreach (var outerwall in singleWallsToDim)
|
||||||
{
|
{
|
||||||
wallList.Remove(outerwall);
|
wallList.Remove(outerwall);
|
||||||
@@ -292,11 +297,11 @@ namespace RookieStation.Drawing.ExecuteCmd
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="doc"></param>
|
/// <param name="doc"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private List<Element> GetWallListToDim(Document doc)
|
private List<Wall> GetWallListToDim(Document doc)
|
||||||
{
|
{
|
||||||
var wallList = doc.QueryInstancesByTypeInView<Wall>(doc.ActiveView).Where(w =>
|
var wallList = doc.QueryInstancesByTypeInView<Wall>(doc.ActiveView).Cast<Wall>().Where(w =>
|
||||||
{
|
{
|
||||||
if (w.Name.Contains("墙饰面") || w.Name.Contains("踢脚线"))
|
if (w.Name.Contains("墙饰面") || w.Name.Contains("踢脚线") || w.Width < 50 / 304.8)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -310,7 +315,7 @@ namespace RookieStation.Drawing.ExecuteCmd
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="doc"></param>
|
/// <param name="doc"></param>
|
||||||
/// <param name="wallList"></param>
|
/// <param name="wallList"></param>
|
||||||
private void CreateInnterWallDimension(Document doc, List<Element> wallList)
|
private void CreateInnterWallDimension(Document doc, List<Wall> wallList)
|
||||||
{
|
{
|
||||||
foreach (Wall wall in wallList)
|
foreach (Wall wall in wallList)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -641,9 +641,9 @@ namespace RookieStation.Drawing.ExecuteCmd
|
|||||||
|
|
||||||
private static void CreateWallDimension(Document doc)
|
private static void CreateWallDimension(Document doc)
|
||||||
{
|
{
|
||||||
var wallList = doc.QueryInstancesByTypeInView<Wall>(doc.ActiveView).Where(w =>
|
var wallList = doc.QueryInstancesByTypeInView<Wall>(doc.ActiveView).Cast<Wall>().Where(w =>
|
||||||
{
|
{
|
||||||
if (w.Name.Contains("墙饰面") || w.Name.Contains("踢脚线"))
|
if (w.Name.Contains("墙饰面") || w.Name.Contains("踢脚线") || w.Width < 50 / 304.8)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ namespace RookieStation.Drawing.ExecuteCmd
|
|||||||
{
|
{
|
||||||
var t = filledRegionTypes.ElementAt(i) as FilledRegionType;
|
var t = filledRegionTypes.ElementAt(i) as FilledRegionType;
|
||||||
//通过名称,类型,把不需要的墙体过滤掉
|
//通过名称,类型,把不需要的墙体过滤掉
|
||||||
if (wallType.Name.Contains("墙饰面") || wallType.Name.Contains("脚线") || wallType.Name.Contains("墙基层") || wallType.Kind != WallKind.Basic)
|
if (wallType.Name.Contains("墙饰面") || wallType.Name.Contains("脚线") || wallType.Name.Contains("墙基层") || wallType.Kind != WallKind.Basic || wallType.Width < 50 / 304.8)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,8 +127,10 @@ namespace RookieStation.Drawing.ExecuteCmd
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
var loc1 = connector1.Origin;
|
var loc1 = connector1.Origin;
|
||||||
List<XYZ> pts = new List<XYZ>();
|
List<XYZ> pts = new List<XYZ>
|
||||||
pts.Add(loc);
|
{
|
||||||
|
loc
|
||||||
|
};
|
||||||
var l = Line.CreateBound(loc, loc1);
|
var l = Line.CreateBound(loc, loc1);
|
||||||
//if (l.Length > 2200 / 304.8)
|
//if (l.Length > 2200 / 304.8)
|
||||||
//{
|
//{
|
||||||
|
|||||||
@@ -138,9 +138,9 @@ namespace RookieStation.MailingAreaModule.ExecuteCmd
|
|||||||
//}
|
//}
|
||||||
List<ElementId> wallIds = new List<ElementId>();
|
List<ElementId> wallIds = new List<ElementId>();
|
||||||
WallType fireRetardantBoard = RsRevitUtils.GetWallTypeByName(doc, "阻燃板");
|
WallType fireRetardantBoard = RsRevitUtils.GetWallTypeByName(doc, "阻燃板");
|
||||||
WallType greyEmulsionPaint = RsRevitUtils.GetWallTypeByName(doc, "灰色乳胶漆");
|
WallType greyEmulsionPaint = RsRevitUtils.GetWallTypeByName(doc, "墙饰面", "灰色乳胶漆");
|
||||||
WallType aluminumPlasticPanel = RsRevitUtils.GetWallTypeByName(doc, "白色铝单板");
|
WallType aluminumPlasticPanel = RsRevitUtils.GetWallTypeByName(doc, "墙饰面", "白色铝单板");
|
||||||
WallType skirtingLine = RsRevitUtils.GetWallTypeByName(doc, "黑钛不锈钢");
|
WallType skirtingLine = RsRevitUtils.GetWallTypeByName(doc, "踢脚线", "黑钛不锈钢", "铝塑板");
|
||||||
//铝塑板块数
|
//铝塑板块数
|
||||||
int n = (int)Math.Floor(referline.Length / interval);
|
int n = (int)Math.Floor(referline.Length / interval);
|
||||||
double rem = referline.Length % (gap + aluminumPlasticPanelLength);
|
double rem = referline.Length % (gap + aluminumPlasticPanelLength);
|
||||||
@@ -212,7 +212,7 @@ namespace RookieStation.MailingAreaModule.ExecuteCmd
|
|||||||
|
|
||||||
CreateReceptionDesk(doc, baseLevel, referline, receptionLength);
|
CreateReceptionDesk(doc, baseLevel, referline, receptionLength);
|
||||||
|
|
||||||
CreateLogo(doc, fireRetardantBoardWidth + aluminumPlasticPanelWidth, baseLevel, referline);
|
CreateLogo(doc, glowTextSymbol, 1700 / 304.8, fireRetardantBoardWidth + aluminumPlasticPanelWidth, baseLevel, referline);
|
||||||
PlacePendentLamp(doc, lampsWallDistance, lampsInterval, lampsHeight, baseLevel, referline, receptionLength);
|
PlacePendentLamp(doc, lampsWallDistance, lampsInterval, lampsHeight, baseLevel, referline, receptionLength);
|
||||||
if (File.Exists(fullFileName))
|
if (File.Exists(fullFileName))
|
||||||
{
|
{
|
||||||
@@ -473,17 +473,22 @@ namespace RookieStation.MailingAreaModule.ExecuteCmd
|
|||||||
}, "接待台布置");
|
}, "接待台布置");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void CreateLogo(Document doc, double offest, Level baseLevel, Line referline)
|
private static void CreateLogo(Document doc, string symbolName, double height, double offest, Level baseLevel, Line referline)
|
||||||
{
|
{
|
||||||
doc.Invoke(ts =>
|
doc.Invoke(ts =>
|
||||||
{
|
{
|
||||||
var file = UserConstant.FamilyLibraryDirectory + "标识标牌\\精工背发光字.rfa";
|
var file = UserConstant.FamilyLibraryDirectory + "标识标牌\\精工背发光字.rfa";
|
||||||
var logoSymbol = RsRevitUtils.GetAndActiveDefaultFamilySymbol(doc, file);
|
var logoSymbol = RsRevitUtils.GetAndActiveFamilySymbolByName(doc, file, symbolName);
|
||||||
|
if (logoSymbol == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var wallCenterPoint = referline.Evaluate(0.5, true);
|
var wallCenterPoint = referline.Evaluate(0.5, true);
|
||||||
|
|
||||||
var logo = doc.Create.NewFamilyInstance(wallCenterPoint, logoSymbol, baseLevel, Autodesk.Revit.DB.Structure.StructuralType.NonStructural);
|
var logo = doc.Create.NewFamilyInstance(wallCenterPoint, logoSymbol, baseLevel, Autodesk.Revit.DB.Structure.StructuralType.NonStructural);
|
||||||
|
logo.get_Parameter(BuiltInParameter.INSTANCE_ELEVATION_PARAM).Set(height);
|
||||||
doc.Regenerate();
|
doc.Regenerate();
|
||||||
RsRevitUtils.AdjustInstance(doc, logo, referline, offest);
|
RsRevitUtils.AdjustInstance(doc, logo, referline, offest);
|
||||||
}
|
}
|
||||||
@@ -502,7 +507,7 @@ namespace RookieStation.MailingAreaModule.ExecuteCmd
|
|||||||
var lightSymbol = RsRevitUtils.GetAndActiveDefaultFamilySymbol(doc, file);
|
var lightSymbol = RsRevitUtils.GetAndActiveDefaultFamilySymbol(doc, file);
|
||||||
var referlineDirection = referline.Direction;
|
var referlineDirection = referline.Direction;
|
||||||
List<XYZ> lampLocationPoints = new List<XYZ>();
|
List<XYZ> lampLocationPoints = new List<XYZ>();
|
||||||
var lampsLocationLine = referline.CreateOffset(lampsWallDistance, -XYZ.BasisZ);
|
var lampsLocationLine = referline.CreateOffset(lampsWallDistance + 615 / 2 / 304.8, -XYZ.BasisZ);
|
||||||
var centerPoint = lampsLocationLine.Evaluate(0.5, true) + XYZ.BasisZ * lampsHeight;
|
var centerPoint = lampsLocationLine.Evaluate(0.5, true) + XYZ.BasisZ * lampsHeight;
|
||||||
|
|
||||||
//n = (int)Math.Floor(backgroundWallLength / lampsInterval);
|
//n = (int)Math.Floor(backgroundWallLength / lampsInterval);
|
||||||
|
|||||||
@@ -117,9 +117,9 @@
|
|||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
hc:InfoElement.Title="菜鸟样式:"
|
hc:InfoElement.Title="菜鸟样式:"
|
||||||
hc:InfoElement.TitlePlacement="Left">
|
hc:InfoElement.TitlePlacement="Left">
|
||||||
<ComboBoxItem Content="955mm x 250mm" IsSelected="True" />
|
<ComboBoxItem Content="955*250mm" IsSelected="True" />
|
||||||
<ComboBoxItem Content="1150mm x 300mm" />
|
<ComboBoxItem Content="1150*300mm" />
|
||||||
<ComboBoxItem Content="1350mm x 350mm" />
|
<ComboBoxItem Content="1350*350mm" />
|
||||||
</hc:ComboBox>
|
</hc:ComboBox>
|
||||||
<hc:TextBox
|
<hc:TextBox
|
||||||
x:Name="tbDwgPath"
|
x:Name="tbDwgPath"
|
||||||
|
|||||||
@@ -241,10 +241,28 @@ namespace RookieStation.Utils
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="wallTypeName">墙类型包含的字符串</param>
|
/// <param name="wallTypeName">墙类型包含的字符串</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static WallType GetWallTypeByName(Document doc, string wallTypeName)
|
public static WallType GetWallTypeByName(Document doc, params string[] wallTypeNames)
|
||||||
{
|
{
|
||||||
var walltypelist = new FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Walls).OfClass(typeof(WallType)).Cast<WallType>();
|
var walltypelist = new FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Walls).OfClass(typeof(WallType)).Cast<WallType>();
|
||||||
return walltypelist.FirstOrDefault(t => t.Name.Contains(wallTypeName));
|
var walltypes = new List<WallType>();
|
||||||
|
bool IsAllContains;
|
||||||
|
foreach (var wallType in walltypelist)
|
||||||
|
{
|
||||||
|
IsAllContains = true;
|
||||||
|
foreach (var wallTypeName in wallTypeNames)
|
||||||
|
{
|
||||||
|
if (!wallType.Name.Contains(wallTypeName))
|
||||||
|
{
|
||||||
|
IsAllContains = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (IsAllContains)
|
||||||
|
walltypes.Add(wallType);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
return walltypes.FirstOrDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -639,6 +657,29 @@ namespace RookieStation.Utils
|
|||||||
return symbol;
|
return symbol;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal static FamilySymbol GetAndActiveFamilySymbolByName(Document doc, string file, string symbolName)
|
||||||
|
{
|
||||||
|
Family family = RsRevitUtils.GetLoadedFamily(doc, file);
|
||||||
|
FamilySymbol symbol = null;
|
||||||
|
if (family != null)
|
||||||
|
{
|
||||||
|
var ids = family.GetFamilySymbolIds();
|
||||||
|
foreach (var id in ids)
|
||||||
|
{
|
||||||
|
symbol = doc.GetElement(id) as FamilySymbol;
|
||||||
|
if (symbol.Name == symbolName)
|
||||||
|
{
|
||||||
|
if (!symbol.IsActive)
|
||||||
|
{
|
||||||
|
symbol.Activate();
|
||||||
|
}
|
||||||
|
return symbol;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return symbol;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取垂直于基准线的最长边
|
/// 获取垂直于基准线的最长边
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user