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


C# Member.Set方法代码示例

本文整理汇总了C#中Member.Set方法的典型用法代码示例。如果您正苦于以下问题:C# Member.Set方法的具体用法?C# Member.Set怎么用?C# Member.Set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Member的用法示例。


在下文中一共展示了Member.Set方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Create

        public static DBObject Create(this Grevit.Types.Column c, Transaction tr)
        {
            DictionaryMemberStyle mst = new DictionaryMemberStyle(Command.Database);

            try
            {
                Member member = new Member();
                member.MemberType = MemberType.Column;


                if (Command.existing_objects.ContainsKey(c.GID))
                {
                    member = (Member)tr.GetObject(Command.existing_objects[c.GID], OpenMode.ForWrite);
                }

                else
                {

                    member.SetDatabaseDefaults(Command.Database);
                    member.SetToStandard(Command.Database);


                    BlockTable bt = (BlockTable)tr.GetObject(Command.Database.BlockTableId, OpenMode.ForRead);
                    BlockTableRecord ms = (BlockTableRecord)tr.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite);
                    ms.AppendEntity(member);
                    tr.AddNewlyCreatedDBObject(member, true);
                }

                LayerTable lt = (LayerTable)tr.GetObject(Command.Database.LayerTableId, OpenMode.ForRead);
                if (c.TypeOrLayer != "") { if (lt.Has(c.TypeOrLayer)) member.LayerId = lt[c.TypeOrLayer]; }
                if (mst.Has(c.FamilyOrStyle, tr)) member.StyleId = mst.GetAt(c.FamilyOrStyle);
                member.Set(c.location.ToPoint3d(), c.locationTop.ToPoint3d());

                return member;
            }

            catch (Autodesk.AutoCAD.Runtime.Exception e)
            {
            }


            return null;
        }
开发者ID:samuto,项目名称:Grevit,代码行数:43,代码来源:CreateExtension.cs

示例2: Create

        public static void Create(Grevit.Types.Column c)
        {
            Database db = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Database;
            Transaction tr = db.TransactionManager.StartTransaction();

            DictionaryMemberStyle mst = new DictionaryMemberStyle(db);

            try
            {
                Member member = new Member();
                member.MemberType = MemberType.Column;

                if (Command.existing_objects.ContainsKey(c.GID))
                {
                    member = (Member)tr.GetObject(Command.existing_objects[c.GID], OpenMode.ForWrite);
                }

                else
                {

                    member.SetDatabaseDefaults(db);
                    member.SetToStandard(db);

                    BlockTable bt = (BlockTable)tr.GetObject(db.BlockTableId, OpenMode.ForRead);
                    BlockTableRecord ms = (BlockTableRecord)tr.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite);
                    ms.AppendEntity(member);
                    tr.AddNewlyCreatedDBObject(member, true);
                }
                LayerTable lt = (LayerTable)tr.GetObject(db.LayerTableId, OpenMode.ForRead);
                if (c.TypeOrLayer != "") { if (lt.Has(c.TypeOrLayer)) member.LayerId = lt[c.TypeOrLayer]; }
                if (mst.Has(c.FamilyOrStyle, tr)) member.StyleId = mst.GetAt(c.FamilyOrStyle);
                member.Set(GrevitPtoPoint3d(c.location), GrevitPtoPoint3d(c.locationTop));

                writeProperties(member, c.parameters, tr);
                AddXData(c, member);
                storeID(c, member.Id);
                tr.Commit();
            }

            catch (Autodesk.AutoCAD.Runtime.Exception e)
            {
                tr.Abort();
            }

            finally
            {
                tr.Dispose();
            }
        }
开发者ID:bbrangeo,项目名称:Grevit,代码行数:49,代码来源:CreateExtension.cs


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