本文整理汇总了C#中Member.SetToStandard方法的典型用法代码示例。如果您正苦于以下问题:C# Member.SetToStandard方法的具体用法?C# Member.SetToStandard怎么用?C# Member.SetToStandard使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Member
的用法示例。
在下文中一共展示了Member.SetToStandard方法的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;
}
示例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();
}
}