Arc length dimensions measure the length along an arc and displays the dimension text with an arc symbol that is either above or proceeds it. You might use an arc length dimension when you need to dimension the actual length of an arc instead of just distance between its start and end points.
弧长标注用于测量沿着圆弧段的长度并使用一个圆弧符号显示标注文字,它不是在标注文字的上面就是前面。当你需要标注圆弧的真实长度而不仅仅是它的起点与终点之间的距离时,可以使用弧长标注。
You create an arc length radius dimenion by creating an instance of an ArcDimension object. When you create an instance of an ArcDimension object, it requires a set of paramters that define the dimension. The following parameters must be supplied when you create a new ArcDimension object:
用户可以通过创建 ArcDimension 对象的实例来创建弧长标注。当用户创建一个 ArcDimension 对象的实例时,它需要一组定义标注的参数。当你创建一个新的 ArcDimension 对象时,下面的参数必须提供:
NoteThe DIMARCSYM system variable controls if an arc symbol is displayed and where it is displayed in relation to the dimension text.
注意 DIMARCSYM 系统变量控制圆弧符号是否显示以及它显示在与它相关的标注文字的什么地方。
For additional information about creating arc length dimensions, see “Create Arc Length Dimensions” in the AutoCAD User's Guide.
更多关于创建弧长标注的详细信息,请参见《AutoCAD 用户手册》中的“创建弧长标注”。
This example creates an arc length dimension in Model space.
本例在模型空间中创建一个弧长标注。
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.Geometry
<CommandMethod("CreateArcLengthDimension")> _
Public Sub CreateArcLengthDimension()
'' 获得当前数据库 Get the current database
Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument
Dim acCurDb As Database = acDoc.Database
''启动一个事务 Start a transaction
Using acTrans As Transaction = acCurDb.TransactionManager.StartTransaction()
'' 以只读方式打开块表 Open the Block table for read
Dim acBlkTbl As BlockTable
acBlkTbl = acTrans.GetObject(acCurDb.BlockTableId, _
OpenMode.ForRead)
'' 以写方式打开模型空间块表记录 Open the Block table record Model space for write
Dim acBlkTblRec As BlockTableRecord
acBlkTblRec = acTrans.GetObject(acBlkTbl(BlockTableRecord.ModelSpace), _
OpenMode.ForWrite)
'' 创建一个弧长标注 Create an arc length dimension
Dim acArcDim As ArcDimension = New ArcDimension(New Point3d(4.5, 1.5, 0), _
New Point3d(8, 4.25, 0), _
New Point3d(0, 2, 0), _
New Point3d(5, 7, 0), _
"<>", _
acCurDb.Dimstyle)
acArcDim.SetDatabaseDefaults()
'' 添加新对象到模型空间和事务中 Add the new object to Model space and the transaction
acBlkTblRec.AppendEntity(acArcDim)
acTrans.AddNewlyCreatedDBObject(acArcDim, True)
'' 提交修改并销毁事务 Commit the changes and dispose of the transaction
acTrans.Commit()
End Using
End Sub
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Geometry;
[CommandMethod("CreateArcLengthDimension")]
public static void CreateArcLengthDimension()
{
// 获得当前数据库 Get the current database
Document acDoc = Application.DocumentManager.MdiActiveDocument;
Database acCurDb = acDoc.Database;
// 启动一个事务 Start a transaction
using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction())
{
// 以只读方式打开块表 Open the Block table for read
BlockTable acBlkTbl;
acBlkTbl = acTrans.GetObject(acCurDb.BlockTableId,
OpenMode.ForRead) as BlockTable;
// 以写方式打开模型空间块表记录 Open the Block table record Model space for write
BlockTableRecord acBlkTblRec;
acBlkTblRec = acTrans.GetObject(acBlkTbl[BlockTableRecord.ModelSpace],
OpenMode.ForWrite) as BlockTableRecord;
// Create an arc length dimension
ArcDimension acArcDim = new ArcDimension(new Point3d(4.5, 1.5, 0),
new Point3d(8, 4.25, 0),
new Point3d(0, 2, 0),
new Point3d(5, 7, 0),
"<>",
acCurDb.Dimstyle);
acArcDim.SetDatabaseDefaults();
// 添加新对象到模型空间和事务中 Add the new object to Model space and the transaction
acBlkTblRec.AppendEntity(acArcDim);
acTrans.AddNewlyCreatedDBObject(acArcDim, true);
// 提交修改并销毁事务 Commit the changes and dispose of the transaction
acTrans.Commit();
}
}