Message 1 of 4
Accessing the vertices of an offset line
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Good day.
I am trying to access the vertices of an offset line. There is no success after intense tries. Can anyone help please?
Here is the code.
The problem is at line 30.
The message is : Object required : Runtime error 424
Private Sub CommandButton10_Click()
Dim Coord1(1) As Double
Dim Coord2(1) As Double
Dim LineObj As AcadLine
Coord1(0) = Me.TextBox1: Coord1(1) = Me.TextBox6
Coord2(0) = Me.TextBox5: Coord2(1) = Me.TextBox4
DrawlineGivenTwoVertices Coord1, Coord2, LineObj
Dim OffsetLinePoints As Variant
Dim OffsetLine As Variant
OffsetLinePoints = LineObj.Offset(20)
Set OffsetLine = OffsetLinePoints(0)
OffsetLine.Color = acGreen
OffsetLine.Update
Dim NumVertices As Integer
Dim ReturnedObj() As Double
Dim vertex1(1) As Double
Dim Vertex2(1) As Double
ReturnedObj = OffsetLinePoints.Coordinates
vertex1(0) = ReturnedObj(0)
vertex1(1) = ReturnedObj(1)
NumVertices = UBound(ReturnedObj)
Vertex2(0) = ReturnedObj(NumVertices)
Vertex2(1) = ReturnedObj(NumVertices)
Dim StraightPline As AcadLWPolyline
DrawPlineGiven2Vertices vertex1, Vertex2, StraightPline
End Sub
*Moderator edit* changed programming language to Visual Basic.