本文整理汇总了C#中Arc.SetDatabaseDefaults方法的典型用法代码示例。如果您正苦于以下问题:C# Arc.SetDatabaseDefaults方法的具体用法?C# Arc.SetDatabaseDefaults怎么用?C# Arc.SetDatabaseDefaults使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Arc
的用法示例。
在下文中一共展示了Arc.SetDatabaseDefaults方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create
public static DBObject Create(this Grevit.Types.Arc a, Transaction tr)
{
try
{
LayerTable lt = (LayerTable)tr.GetObject(Command.Database.LayerTableId, OpenMode.ForRead);
Arc arc = new Arc(a.center.ToPoint3d(), a.radius, a.start, a.end);
arc.SetDatabaseDefaults(Command.Database);
if (lt.Has(a.TypeOrLayer)) arc.LayerId = lt[a.TypeOrLayer];
BlockTable bt = (BlockTable)tr.GetObject(Command.Database.BlockTableId, OpenMode.ForRead);
BlockTableRecord ms = (BlockTableRecord)tr.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite);
ms.AppendEntity(arc);
tr.AddNewlyCreatedDBObject(arc, true);
ms.Dispose();
return arc;
}
catch (Autodesk.AutoCAD.Runtime.Exception e)
{
}
return null;
}
示例2: Create
public static void Create(Grevit.Types.Arc a)
{
Database db = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Database;
Transaction tr = db.TransactionManager.StartTransaction();
Editor ed = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
try
{
LayerTable lt = (LayerTable)tr.GetObject(db.LayerTableId, OpenMode.ForRead);
Arc arc = new Arc(GrevitPtoPoint3d(a.center), a.radius, a.start, a.end);
arc.SetDatabaseDefaults(db);
if (lt.Has(a.TypeOrLayer)) arc.LayerId = lt[a.TypeOrLayer];
BlockTable bt = (BlockTable)tr.GetObject(db.BlockTableId, OpenMode.ForRead);
BlockTableRecord ms = (BlockTableRecord)tr.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite);
ms.AppendEntity(arc);
tr.AddNewlyCreatedDBObject(arc, true);
writeProperties(arc, a.parameters, tr);
storeID(a, arc.Id);
tr.Commit();
}
catch (Autodesk.AutoCAD.Runtime.Exception e)
{
ed.WriteMessage(e.Message);
tr.Abort();
}
finally
{
tr.Dispose();
}
}