我想看一级黄色大片_久久亚洲国产精品一区二区_久久精品免视看国产明星_91久久青青青国产免费

您的位置:網(wǎng)站首頁 > CAD新聞

VB編程編輯AutoCAD輕量多義線

時(shí)間:2012-01-18 10:37:43 來源:未知

創(chuàng)建一條輕量多義線并將第二段修改為圓弧。

Private Sub Command1_Click()
    Dim plineobj As AcadLWPolyline
    Dim points(0 To 9) As Double
    points(0) = 1: points(1) = 1
    points(2) = 1: points(3) = 2
    points(4) = 2: points(5) = 2
    points(6) = 3: points(7) = 2
    points(8) = 4: points(9) = 4
    Set plineobj = acadapp.ActiveDocument.ModelSpace.AddLightWeightPolyline(points)
    plineobj.SetBulge 2, 1
    plineobj.Update
    ZoomExtents
End Sub

給輕量多義線添加新定點(diǎn),設(shè)置線寬,封閉多義線,計(jì)算多義線圍成的面積。

Private Sub Command1_Click()
    Dim plineobj As AcadLWPolyline
    Dim points(0 To 9) As Double
    points(0) = 1: points(1) = 1
    points(2) = 1: points(3) = 2
    points(4) = 2: points(5) = 2
    points(6) = 3: points(7) = 2
    points(8) = 4: points(9) = 4
    Set plineobj = acadapp.ActiveDocument.ModelSpace.AddLightWeightPolyline(points)
    plineobj.SetBulge 2, 1
    plineobj.Update
    ZoomExtents
    Dim newvertex(0 To 1) As Double
    newvertex(0) = 4: newvertex(1) = 1
    plineobj.AddVertex 5, newvertex
    plineobj.SetWidth 4, 0.1, 0.5
    plineobj.Closed = True
    MsgBox "多義線圍成的面積=" & plineobj.Area
    plineobj.Update
End Sub


相關(guān)文章