Select to view content in your preferred language

VB .NET drawing a line between two points

3140
10
Jump to solution
03-07-2012 05:34 AM
Gregde_Bruin
Deactivated User
Hi,

I'm attempting to fix someone's code that draws a line betweent two points. I'm converting it from VBA to VB .NET.

This section appears to be where it's failing. Right after Debug 8.1 or 8.2

  'Draw line between points
Dim calcLength As Double

pSegmentCollection = New Path
pLine = New Line

'Draw a line between first point and second point (FromPoint and ToPoint)
pLine.PutCoords(ToPoint, FromPoint)
Debug.Print("8.1")
calcLength = pLine.Length
Debug.Print("8.2")
pSegmentCollection.AddSegment(pLine)
Debug.Print("8.3")

Any help is appreciated.

Thank you,
cdebruin
0 Kudos
10 Replies
Gregde_Bruin
Deactivated User
Greg:

Have you tried looking at python to accomplish this task?  It would probably result in a lot less code on your part.  In v10.1 you will be able to associate python code with buttons on a toolbar which should make this even easier.


I'm Greg's son Corbin, just using his account.

I'm only just learning vb.net as a first language and introduction into comp programming. I was told by my Greg that it would be a simple start to translate our old VBA code to vb.net for use with Desktop 10. I could venture into another language eventually, but for now I think it's best I just learn one comlpletely. I don't want to be learning two languages at the same time and mixing them up.
0 Kudos