当前位置: 首页>>代码示例>>C#>>正文


C# Door.SetToStandard方法代码示例

本文整理汇总了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;
        }
开发者ID:samuto,项目名称:Grevit,代码行数:43,代码来源:CreateExtension.cs

示例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);
        }
开发者ID:bbrangeo,项目名称:Grevit,代码行数:38,代码来源:CreateExtension.cs


注:本文中的Door.SetToStandard方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。