您的位置:网站首页 > CAD新闻

VB编程操作AutoCAD坐标型尺寸标注

时间:2012-01-15 09:31:23 来源:未知

坐标型尺寸标注用来标注零部件上某点相对于原点的垂直距离,创建坐标型尺寸标注对象用AddDimOrdinate方法,语法格式如下。

RetVal=object.AddDimOrdinate(DefinitionPoint,LeaderEndPoint,UseXAxis)

下面的代码创建一个坐标型尺寸标注。

Private Sub Command1_Click()
    Dim dimobj As AcadDimOrdinate
    Dim definingpoint(0 To 2) As Double
    Dim leaderendpoint(0 To 2) As Double
    Dim usexaxis As Boolean
    definingpoint(0) = 12#: definingpoint(1) = 8#: definingpoint(2) = 0#
    leaderendpoint(0) = 20#: leaderendpoint(1) = 13#: leaderendpoint(2) = 0#
    usexaxis = False
    Set dimobj = acadapp.ActiveDocument.ModelSpace.AddDimOrdinate(definingpoint, leaderendpoint, usexaxis)
    ZoomExtents
End Sub