AcadLine.StartPoint not recognized

AcadLine.StartPoint not recognized

Anonymous
Not applicable
883 Views
2 Replies
Message 1 of 3

AcadLine.StartPoint not recognized

Anonymous
Not applicable
Hi everyone. I wrote the following code:

Dim ent As AcadEntity
Dim startpoint As Variant
Dim x As Double, y As Double, z As Double

For Each ent In Thisdrawing.modelspace

startpoint = AcadLine.startpoint
x = startpoint(0)
y = startpoint(1)
z = startpoint(2)

MsgBox x

AcadLine.startpoint always returns "0". Note that there are no capital letters in startpoint. The same thing happens when i'm looking for the endpoint. I could really use some help.

thnx
0 Likes
884 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
See my reply to your prev. post.

wrote in message news:5790614@discussion.autodesk.com...
Hi everyone. I wrote the following code:

Dim ent As AcadEntity
Dim startpoint As Variant
Dim x As Double, y As Double, z As Double

For Each ent In Thisdrawing.modelspace

startpoint = AcadLine.startpoint
x = startpoint(0)
y = startpoint(1)
z = startpoint(2)

MsgBox x

AcadLine.startpoint always returns "0". Note that there are no capital
letters in startpoint. The same thing happens when i'm looking for the
endpoint. I could really use some help.

thnx
0 Likes
Message 3 of 3

pdr0663
Explorer
Explorer

Not sure where acadline gets initialized...

Here's what I would try:

 

Dim ent As AcadEntity

dim acLine as AcadLine
Dim startpoint As Variant
Dim x As Double, y As Double, z As Double

For Each ent In Thisdrawing.modelspace
if ent.ObjectName = "AcDbLine" then

  set acLine = ent
  startpoint = acLine.startpoint

 

  x = startpoint(0)
  y = startpoint(1)
  z = startpoint(2)

 

  MsgBox x

 

end if

 

next ent

0 Likes