Private Sub CommandButton1_Click()Private Function AddLWPlineArc(ByVal ptCen As Variant, ByVal radius As Double, ByVal angleSt As Double, ByVal angleEn As Double, ByVal width As Double) As AcadLWPolyline
Dim objPline As AcadLWPolyline
Dim ptCen(0 To 1) As Variant
Dim radius As Double
Dim angleSt As Double
Dim angleEn As Double
Dim width As Double
ptCen(0) = Val(TextBox8.Text)
ptCen(1) = Val(TextBox7.Text)
radius = Val(TextBox3.Text)
angleSt = Val(TextBox4.Text)
angleEn = Val(TextBox5.Text)
wdth = Val(TextBox6.Text)
Dim ptArr(0 To 3) As Double
ptArr(0) = ptCen(0) + radius * Cos(angleSt)
ptArr(1) = ptCen(1) + radius * Sin(angleSt)
ptArr(2) = ptCen(0) + radius * Cos(angleEn)
ptArr(3) = ptCen(1) + radius * Sin(angleEn)
Set objPline = ThisDrawing.ModelSpace.AddLightWeightPolyline(ptArr)
objPline.ConstantWidth = width
If angleEn < angleSt Then
angleSt = angleSt - 8 * Ant(1)
End If
objPline.SetBulge 0, Tan((angleEn - angleSt) / 4)
objPline.SetBulge 1, 0
objPline.Update
Set AddLWPlineArc = objPline
End Function
手掌心
潇潇雨雨
相关分类