Ordinate, or datum, dimensions measure the perpendicular distance from an origin point, called the datum, to a dimensioned feature, such as a hole in a part. These dimensions prevent escalating errors by maintaining accurate offsets of the features from the datum.
坐标或基准标注用于测量从原点或称为基准点到被标注的特征象部件上的孔之间的垂直距离。这些标注通过保持特征与基准点之间的精确偏移量,来避免误差增大。
Ordinate dimensions consist of an X or Y ordinate with a leader line. X-datum ordinate dimensions measure the distance of a feature from the datum along the X axis. Y-datum ordinate dimensions measure the same distance along the Y axis. AutoCAD uses the origin of the current user coordinate system (UCS) to determine the measured coordinates. The absolute value of the coordinate is used.
坐标标注由带引线的 X 或 Y 坐标组成。X 基准坐标标注沿 X 轴测量特征点与基准点的距离。Y 基准坐标标注沿着 Y 轴测量相同的距离。AutoCAD 使用当前用户坐标系 (UCS) 的原点确定测量的坐标。坐标使用绝对值。
The dimension text is aligned with the ordinate leader line regardless of the orientation defined by the current dimension style. You can accept the default text or override it with your own.
标注文字将与坐标引线对齐,而不考虑当前标注样式定义的文字方向。用户可以接受默认文字,也可以提供自己的文字。
You create an ordinate dimension by creating an instance of an OrdinateDimension object. When you create an instance of an OrdinateDimension object, its constructor can accept an optional set of parameters. The following parameters can be supplied when you create a new OrdinateDimension object:
用户通过创建 OrdinateDimension 对象的实例来创建坐标标注。当用户创建一个 OrdinateDimension 对象的实例时,它的构造函数可以接受任意一组参数。当创建一个新的 OrdinateDimension 对象时,可以提供下列参数:
When passing values into the OrdinateDimension object constructor, the first value is a boolean flag which specifies whether the dimension is an X-datum or Y-datum ordinate dimension. If you enter TRUE, an X-datum ordinate dimension is created. If you enter FALSE, a Y-datum ordinate dimension is created. The UsingXAxis property can also be used to specify if an ordinate dimension is an X-datum or Y-datum.
当传递值给 OrdinateDimension 对象的构造函数时,第一个值是一个布尔值标识,它指出标注是 X 基准还是 Y 基准坐标标注。如果输入 True,一个 X 基准坐标标注将被创建。如果输入 False,一个 Y 基准坐标标注将会被创建。UsingXAxis 属性也可以用于指定一个坐标标注是 X 基准还是 Y 基准。
For additional information about creating ordinate dimensions, see “Create Ordinate Dimensions” in the AutoCAD User's Guide.
有关创建坐标标注的附加信息,请参见《 AutoCAD 用户手册》中的“创建坐标标注”。
This example creates an ordinate dimension in Model space.
本例在模型空间中创建一个坐标标注。
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.Geometry
<CommandMethod("CreateOrdinateDimension")> _
Public Sub CreateOrdinateDimension()
'' 获得当前数据库 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 ordinate dimension
Dim acOrdDim As OrdinateDimension = New OrdinateDimension()
acOrdDim.SetDatabaseDefaults()
acOrdDim.UsingXAxis = True
acOrdDim.DefiningPoint = New Point3d(5, 5, 0)
acOrdDim.LeaderEndPoint = New Point3d(10, 5, 0)
acOrdDim.DimensionStyle = acCurDb.Dimstyle
'' 添加新对象到模型空间和事务中 Add the new object to Model space and the transaction
acBlkTblRec.AppendEntity(acOrdDim)
acTrans.AddNewlyCreatedDBObject(acOrdDim, 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("CreateOrdinateDimension")]
public static void CreateOrdinateDimension()
{
// 获得当前数据库 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 ordinate dimension
OrdinateDimension acOrdDim = new OrdinateDimension();
acOrdDim.SetDatabaseDefaults();
acOrdDim.UsingXAxis = true;
acOrdDim.DefiningPoint = new Point3d(5, 5, 0);
acOrdDim.LeaderEndPoint = new Point3d(10, 5, 0);
acOrdDim.DimensionStyle = acCurDb.Dimstyle;
// 添加新对象到模型空间和事务中 Add the new object to Model space and the transaction
acBlkTblRec.AppendEntity(acOrdDim);
acTrans.AddNewlyCreatedDBObject(acOrdDim, true);
// 提交修改并销毁事务 Commit the changes and dispose of the transaction
acTrans.Commit();
}
}