本文整理汇总了C#中Door.SetToStandard方法的典型用法代码示例。如果您正苦于以下问题:C# Door.SetToStandard方法的具体用法?C# Door.SetToStandard怎么用?C# Door.SetToStandard使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Door
的用法示例。
在下文中一共展示了Door.SetToStandard方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create
public static DBObject Create(this Grevit.Types.Door door, Transaction tr, Wall wall)
{
BlockTable bt = (BlockTable)tr.GetObject(Command.Database.BlockTableId, OpenMode.ForRead);
BlockTableRecord ms = (BlockTableRecord)tr.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite);
Door d = new Door();
DictionaryDoorStyle dds = new DictionaryDoorStyle(Command.Database);
bool newEnt = false;
if (Command.existing_objects.ContainsKey(door.GID))
{
d = (Door)tr.GetObject(Command.existing_objects[door.GID], OpenMode.ForWrite);
}
else
{
d.SetDatabaseDefaults(Command.Database);
d.SetToStandard(Command.Database);
AnchorOpeningBaseToWall w = new AnchorOpeningBaseToWall();
w.SetToStandard(Command.Database);
w.SubSetDatabaseDefaults(Command.Database);
d.SetAnchor(w);
newEnt = true;
w.SetSingleReference(wall.Id, Autodesk.Aec.DatabaseServices.RelationType.OwnedBy);
}
Point3d pkt = new Point3d(door.locationPoint.x, door.locationPoint.y + (wall.Width / 2), door.locationPoint.z);
d.Location = pkt;
LayerTable lt = (LayerTable)tr.GetObject(Command.Database.LayerTableId, OpenMode.ForRead);
if (door.TypeOrLayer != "") { if (lt.Has(door.TypeOrLayer)) d.LayerId = lt[door.TypeOrLayer]; }
if (dds.Has(door.FamilyOrStyle, tr)) d.StyleId = dds.GetAt(door.FamilyOrStyle);
if (newEnt)
{
ms.AppendEntity(d);
tr.AddNewlyCreatedDBObject(d, true);
ms.Dispose();
}
return d;
}
示例2: Create
public static void Create(Database db, Grevit.Types.Door door, Wall wall, Transaction tr, BlockTableRecord ms)
{
Door d = new Door();
DictionaryDoorStyle dds = new DictionaryDoorStyle(db);
bool newEnt = false;
if (Command.existing_objects.ContainsKey(door.GID))
{
d = (Door)tr.GetObject(Command.existing_objects[door.GID], OpenMode.ForWrite);
}
else
{
d.SetDatabaseDefaults(db);
d.SetToStandard(db);
AnchorOpeningBaseToWall w = new AnchorOpeningBaseToWall();
w.SetToStandard(db);
w.SubSetDatabaseDefaults(db);
d.SetAnchor(w);
newEnt = true;
w.SetSingleReference(wall.Id, Autodesk.Aec.DatabaseServices.RelationType.OwnedBy);
}
Point3d pkt = new Point3d(door.locationPoint.x, door.locationPoint.y + (wall.Width / 2), door.locationPoint.z);
d.Location = pkt;
LayerTable lt = (LayerTable)tr.GetObject(db.LayerTableId, OpenMode.ForRead);
if (door.TypeOrLayer != "") { if (lt.Has(door.TypeOrLayer)) d.LayerId = lt[door.TypeOrLayer]; }
if (dds.Has(door.FamilyOrStyle, tr)) d.StyleId = dds.GetAt(door.FamilyOrStyle);
if (newEnt)
{
AddXData(door, d);
ms.AppendEntity(d);
tr.AddNewlyCreatedDBObject(d, true);
}
writeProperties(d, door.parameters, tr);
storeID(door, d.Id);
}