代码改变世界

VB编程操作AutoCAD角度型尺寸标注

2011-06-18 21:53  精诚所至 金石为开  阅读(491)  评论(0编辑  收藏  举报

角度型尺寸标注用来标注两条直线或三个点之间的角度,创建角度型尺寸标注对象AddDimAngular方法,语法格式如下。

RetVal=object.AddDimangular(AngleVertex,FirstEndPoint,SecondEndPoint,TextPoint)

下面的代码创建一个角度型标注对象。

Private Sub Command1_Click()
    Dim angvert(0 To 2) As Double
    Dim firstpoint(0 To 2) As Double
    Dim secondpoint(0 To 2) As Double
    Dim textpoint(0 To 2) As Double
    angvert(0) = 0#: angvert(1) = 5#: angvert(2) = 0#
    firstpoint(0) = 1#: firstpoint(1) = 6#: firstpoint(2) = 0#
    secondpoint(0) = 1#: secondpoint(1) = 3#: secondpoint(2) = 0#
    textpoint(2) = 20#: textpoint(1) = 5#: textpoint(2) = 0#
    Set dimobj = acadapp.ActiveDocument.ModelSpace.AddDimAngular(angvert, firstpoint, secondpoint, textpoint)
    ZoomExtents
End Sub