Object Required message not understood (1 Viewer)

grenee

Registered User.
Local time
Today, 13:33
Joined
Mar 5, 2012
Messages
212
Good Day.
I my module there is a pop-up message: "Object Required"
But a Polyline Object is passed as an argument.
Looking at the code can anyone explain why this message is appearing?
Please note that if this code is cut and paste into an existing module it works fine.

Here is the code:
The message appears at line 7: Vertex3
Code:
Public Sub DrawRightSideLineOfOffsetPolyLinePattern(ByRef PlineObj As AcadLWPolyline)

  Dim Vertex3() As Double
  Dim Vertex4() As Double
 
  Dim lineObj As AcadLine
  Dim OffsetLineObjPoints() As Double
  Dim OffsetLineObj As AcadLine

  Vertex3 = OffsetPolyline.Coordinate(0)
  Vertex4 = OffsetPolyline.Coordinate(11)
  Call DrawlineGivenTwoVertices(Vertex3, Vertex4, lineObj)

  lineObj.Color = acYellow
  lineObj.Update
 
End Sub
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 16:33
Joined
May 21, 2018
Messages
8,556
Vertex3 is an array of doubles but you are setting it equal to offsetPllyline.coordinate(0). I assume offsetPollyLine.Coordiante(0) is not an array of doubles.

Do you want to set one element of vertex3 to it? Maybe
vertex3(0) = offsetPolyLine.Coordinate(0)

setting the first element of vertex3 to the whatever offsetPolyLine.Coordinate(0) is. (Hopefully a double)
 

MarkK

bit cruncher
Local time
Today, 13:33
Joined
Mar 17, 2004
Messages
8,186
Vertex3 = OffsetPolyline.Coordinate(0)
OffsetPolyline is neither declared, nor assigned a value in the code you posted, but you try to reference it's Coordinate() member.
 

grenee

Registered User.
Local time
Today, 13:33
Joined
Mar 5, 2012
Messages
212
OffsetPolyline is neither declared, nor assigned a value in the code you posted, but you try to reference it's Coordinate() member.
Thanks. This is the problem. I forgot to change OffsetPolyline to the argument: PlineObj
 

Users who are viewing this thread

Top Bottom