I'm looking for help in drawing a polyline by selecting a start point, then a direction to set my xaxis. then I want to draw a polyline box based
on the selected start points and direction.
If it's possible I'd like something that works like my old vba sample (see below). I'm just not understanding how to create the same in dot net. I've tried several times to get started in dot net over that last year but end up giving up because I can't get all the parts linked together. If I can get a working sample that reproduces drawing a ployline box by direction I might be able to get over them hill and move forward. I have tons of old vba routines that basically draw tons of geometry and finally need to convert them to dot net.
any help is welcome
Thanks
john Coon
'this is basically what I was using in vba
point1 = ThisDrawing.Utility.GetPoint(, "Pick start point,")
point2 = ThisDrawing.Utility.GetPoint(point1, "Select Direction to draw")
Dim dblRot As Double
Dim pi As Double
pi = 3.14159265358979
dblRot = ThisDrawing.Utility.AngleFromXAxis(pt1, pt2)
Dim worldcoords As Integer
worldcoords = -ThisDrawing.GetVariable("WORLDUCS")
If worldcoords = 0 Then
dblRot = 0
If worldcoords = 1 Then
dblRot = ThisDrawing.Utility.AngleFromXAxis(pt1, pt2)
End If
End If
Dim newpt1001 As Variant
Dim newpt1002 As Variant
Dim newpt1003 As Variant
Dim newpt1004 As Variant
Dim newpt1005 As Variant
Dim newpt1006 As Variant
'draws threshold box
newpt1001 = ThisDrawing.Utility.PolarPoint(pt1, (pi + dblRot), -0#)
newpt1002 = ThisDrawing.Utility.PolarPoint(pt1, (pi + dblRot), -10)
newpt1003 = ThisDrawing.Utility.PolarPoint(newpt1001, (1.570796327 + dblRot), -100/2) 'from newpt1001 turn 90 deg angle, set -100'
newpt1004 = ThisDrawing.Utility.PolarPoint(newpt1001, (1.570796327 + dblRot), 100/2) 'from newpt1001 turn 90 deg angle, set 100'
newpt1005 = ThisDrawing.Utility.PolarPoint(newpt1002, (1.570796327 + dblRot), -100/2) 'from newpt1002 turn 90 deg angle, set -100'
newpt1006 = ThisDrawing.Utility.PolarPoint(newpt1002, (1.570796327 + dblRot), 100/2) 'from newpt1002 turn 90 deg angle, set 100'
' Call checkcombo1(cboLayer1.Text)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim DRWPOLYAPPR1 As AcadLWPolyline
Dim polyponts1(11) As Double
polyponts1(0) = newpt1001(0): polyponts1(1) = newpt1001(1)
polyponts1(2) = newpt1003(0): polyponts1(3) = newpt1003(1)
polyponts1(4) = newpt1005(0): polyponts1(5) = newpt1005(1)
polyponts1(6) = newpt1006(0): polyponts1(7) = newpt1006(1)
polyponts1(
= newpt1004(0): polyponts1(9) = newpt1004(1)
polyponts1(10) = newpt1001(0): polyponts1(11) = newpt1001(1)
Set DRWPOLYAPPR1 = ThisDrawing.ModelSpace.AddLightWeightPolyline(polyponts1)