日常更新
This commit is contained in:
@@ -48,13 +48,18 @@ namespace RookieStation.Drawing.ExecuteCmd
|
||||
};
|
||||
//房间边界
|
||||
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("提示", "目前仅支持独立单栋建筑形式。");
|
||||
return Result.Failed;
|
||||
segments = boundingseg[2];
|
||||
}
|
||||
//内部边界
|
||||
segments = boundingseg.LastOrDefault();
|
||||
foreach (BoundarySegment segment in segments)
|
||||
{
|
||||
var curve = segment.GetCurve() as Line;
|
||||
@@ -81,7 +86,7 @@ namespace RookieStation.Drawing.ExecuteCmd
|
||||
doc.Invoke(ts =>
|
||||
{
|
||||
CreateOuterWallsDimByReferLines(doc, dics);
|
||||
List<Element> wallList = GetWallListToDim(doc);
|
||||
List<Wall> wallList = GetWallListToDim(doc);
|
||||
foreach (var outerwall in singleWallsToDim)
|
||||
{
|
||||
wallList.Remove(outerwall);
|
||||
@@ -292,11 +297,11 @@ namespace RookieStation.Drawing.ExecuteCmd
|
||||
/// </summary>
|
||||
/// <param name="doc"></param>
|
||||
/// <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;
|
||||
}
|
||||
@@ -310,7 +315,7 @@ namespace RookieStation.Drawing.ExecuteCmd
|
||||
/// </summary>
|
||||
/// <param name="doc"></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)
|
||||
{
|
||||
|
||||
@@ -641,9 +641,9 @@ namespace RookieStation.Drawing.ExecuteCmd
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace RookieStation.Drawing.ExecuteCmd
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -127,8 +127,10 @@ namespace RookieStation.Drawing.ExecuteCmd
|
||||
break;
|
||||
}
|
||||
var loc1 = connector1.Origin;
|
||||
List<XYZ> pts = new List<XYZ>();
|
||||
pts.Add(loc);
|
||||
List<XYZ> pts = new List<XYZ>
|
||||
{
|
||||
loc
|
||||
};
|
||||
var l = Line.CreateBound(loc, loc1);
|
||||
//if (l.Length > 2200 / 304.8)
|
||||
//{
|
||||
|
||||
@@ -138,9 +138,9 @@ namespace RookieStation.MailingAreaModule.ExecuteCmd
|
||||
//}
|
||||
List<ElementId> wallIds = new List<ElementId>();
|
||||
WallType fireRetardantBoard = RsRevitUtils.GetWallTypeByName(doc, "阻燃板");
|
||||
WallType greyEmulsionPaint = RsRevitUtils.GetWallTypeByName(doc, "灰色乳胶漆");
|
||||
WallType aluminumPlasticPanel = RsRevitUtils.GetWallTypeByName(doc, "白色铝单板");
|
||||
WallType skirtingLine = RsRevitUtils.GetWallTypeByName(doc, "黑钛不锈钢");
|
||||
WallType greyEmulsionPaint = RsRevitUtils.GetWallTypeByName(doc, "墙饰面", "灰色乳胶漆");
|
||||
WallType aluminumPlasticPanel = RsRevitUtils.GetWallTypeByName(doc, "墙饰面", "白色铝单板");
|
||||
WallType skirtingLine = RsRevitUtils.GetWallTypeByName(doc, "踢脚线", "黑钛不锈钢", "铝塑板");
|
||||
//铝塑板块数
|
||||
int n = (int)Math.Floor(referline.Length / interval);
|
||||
double rem = referline.Length % (gap + aluminumPlasticPanelLength);
|
||||
@@ -212,7 +212,7 @@ namespace RookieStation.MailingAreaModule.ExecuteCmd
|
||||
|
||||
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);
|
||||
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 =>
|
||||
{
|
||||
var file = UserConstant.FamilyLibraryDirectory + "标识标牌\\精工背发光字.rfa";
|
||||
var logoSymbol = RsRevitUtils.GetAndActiveDefaultFamilySymbol(doc, file);
|
||||
var logoSymbol = RsRevitUtils.GetAndActiveFamilySymbolByName(doc, file, symbolName);
|
||||
if (logoSymbol == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
var wallCenterPoint = referline.Evaluate(0.5, true);
|
||||
|
||||
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();
|
||||
RsRevitUtils.AdjustInstance(doc, logo, referline, offest);
|
||||
}
|
||||
@@ -502,7 +507,7 @@ namespace RookieStation.MailingAreaModule.ExecuteCmd
|
||||
var lightSymbol = RsRevitUtils.GetAndActiveDefaultFamilySymbol(doc, file);
|
||||
var referlineDirection = referline.Direction;
|
||||
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;
|
||||
|
||||
//n = (int)Math.Floor(backgroundWallLength / lampsInterval);
|
||||
|
||||
@@ -117,9 +117,9 @@
|
||||
HorizontalAlignment="Stretch"
|
||||
hc:InfoElement.Title="菜鸟样式:"
|
||||
hc:InfoElement.TitlePlacement="Left">
|
||||
<ComboBoxItem Content="955mm x 250mm" IsSelected="True" />
|
||||
<ComboBoxItem Content="1150mm x 300mm" />
|
||||
<ComboBoxItem Content="1350mm x 350mm" />
|
||||
<ComboBoxItem Content="955*250mm" IsSelected="True" />
|
||||
<ComboBoxItem Content="1150*300mm" />
|
||||
<ComboBoxItem Content="1350*350mm" />
|
||||
</hc:ComboBox>
|
||||
<hc:TextBox
|
||||
x:Name="tbDwgPath"
|
||||
|
||||
@@ -241,10 +241,28 @@ namespace RookieStation.Utils
|
||||
/// </summary>
|
||||
/// <param name="wallTypeName">墙类型包含的字符串</param>
|
||||
/// <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>();
|
||||
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>
|
||||
@@ -639,6 +657,29 @@ namespace RookieStation.Utils
|
||||
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>
|
||||
|
||||
Reference in New Issue
Block a user