Copy method example

Sub Copy_and_Rotate_Example()
' This example creates a line and then copies it.
' The new line is then rotated 10 radians.
    ' Create the line
    Dim myLine As AcadLine
    Dim myStartPt(0 To 2) As Double
    Dim myEndPt(0 To 2) As Double
    myStartPt(0) = 4: myStartPt(1) = 4: myStartPt(2) = 0
    myEndPt(0) = 7: myEndPt(1) = 3: myEndPt(2) = 0
    Set myLine = ThisDrawing.ModelSpace.AddLine(myStartPt, myEndPt)
    myLine.Update
    ' Copy and rotate the line
    Dim copyMyLine As AcadLine
    Set copyMyLine = myLine.Copy()
    copyMyLine.Rotate myStartPt, 10
    MsgBox "Rotated the copied line 10 radians."
    ThisDrawing.Application.ZoomExtents
End Sub

© Bricsys NV. All rights reserved.