本文整理汇总了C#中Point2d.Convert3d方法的典型用法代码示例。如果您正苦于以下问题:C# Point2d.Convert3d方法的具体用法?C# Point2d.Convert3d怎么用?C# Point2d.Convert3d使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Point2d
的用法示例。
在下文中一共展示了Point2d.Convert3d方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: addWindows
private void addWindows(BlockTableRecord btrPanel, Transaction t)
{
// все окна и балеоны в панели
var windows = Panel.windows?.window?.Select(w => new { posi = w.posi, width = w.width, height = w.height });
var balconys = Panel.balconys?.balcony?.Select(b => new { posi = b.posi, width = b.width, height = b.height });
var apertures = balconys==null? windows: windows?.Union(balconys)?? balconys;
if (apertures != null)
{
foreach (var item in apertures)
{
// контур окон
Polyline plWindow = new Polyline();
plWindow.LayerId = Service.Env.IdLayerContourPanel;
Point2d ptMinWindow = new Point2d(item.posi.X, item.posi.Y);
plWindow.AddVertexAt(0, ptMinWindow, 0, 0, 0);
plWindow.AddVertexAt(0, new Point2d(ptMinWindow.X, ptMinWindow.Y + item.height), 0, 0, 0);
Point2d ptMaxWindow = new Point2d(ptMinWindow.X + item.width, ptMinWindow.Y + item.height);
plWindow.AddVertexAt(0, ptMaxWindow, 0, 0, 0);
plWindow.AddVertexAt(0, new Point2d(ptMinWindow.X + item.width, ptMinWindow.Y), 0, 0, 0);
plWindow.Closed = true;
btrPanel.AppendEntity(plWindow);
t.AddNewlyCreatedDBObject(plWindow, true);
// добавление точек для верхнего образмеривания.
PtsForTopDim.Add(ptMinWindow.X);
PtsForTopDim.Add(ptMaxWindow.X);
Openings.Add(new Extents3d(ptMinWindow.Convert3d(), ptMaxWindow.Convert3d()));
// Вставка окон
if (WindowsBaseCenters.Count > 0)
{
var xCenter = item.posi.X + item.width * 0.5;
var winMarkMin = WindowsBaseCenters.Where(w => Math.Abs(w.Key.X - xCenter) < 600);
if (winMarkMin.Count() > 0)
{
var winMark = winMarkMin.MinBy(g => (g.Key.X - xCenter));
if (string.IsNullOrWhiteSpace(winMark.Value))
{
continue;
}
// Точка вставки блока окна
Point3d ptWin = new Point3d(item.posi.X, item.posi.Y, 0);
// Вставка блока окна
if (!Service.Env.IdBtrWindow.IsNull)
{
BlockReference blRefWin = new BlockReference(ptWin, Service.Env.IdBtrWindow);
blRefWin.LayerId = Service.Env.IdLayerWindow;
btrPanel.AppendEntity(blRefWin);
t.AddNewlyCreatedDBObject(blRefWin, true);
var resSetDyn = BlockWindow.SetDynBlWinMark(blRefWin, winMark.Value);
if (!resSetDyn)
{
// Добавление текста марки окна
DBText dbTextWin = new DBText();
dbTextWin.Position = ptWin;
dbTextWin.LayerId = Service.Env.IdLayerWindow;
dbTextWin.TextString = winMark.Value;
dbTextWin.Height = 180;
btrPanel.AppendEntity(dbTextWin);
t.AddNewlyCreatedDBObject(dbTextWin, true);
}
}
#if Test
// Test
else
{
// Добавление текста марки окна
DBText dbTextWin = new DBText();
dbTextWin.Position = ptWin;
dbTextWin.LayerId = Service.Env.IdLayerWindow;
dbTextWin.TextString = winMark.Value;
dbTextWin.Height = 180;
btrPanel.AppendEntity(dbTextWin);
t.AddNewlyCreatedDBObject(dbTextWin, true);
}
#endif
}
}
// Сортировка окон слева-направо
Openings.Sort((w1, w2) => w1.MinPoint.X.CompareTo(w2.MinPoint.X));
}
}
}