hi
i m using .net form,Autocad and lisp
to generate a drawing
First i prompt user to pick a starting point and then i show dialog box developed in .net , if user clicks on conitnue button in dialog box
and next i prompt the user to enter the ending point
now basing on the starting point and ending point , i generate a drawing using lisp program
i pass these two points to lisp function command as a input
then it will generate a drawing (some rectangles,plines,text etc)
this process should stop while user clicks end button in dialog box
here is my code
_
Public Sub HelloCommand()
AcadDoc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument
acadApp.DocumentManager.MdiActiveDocument.SendStringToExecute("(LOAD " & Chr(34) + "c:/LispSld/myline.lsp" & Chr(34) & " )" & vbCr, True, False, True)
PointArryListX = New ArrayList
PointArryListY = New ArrayList
Dim plp As String = ""
Dim f As dotnetApp.Form1
Dim askpoint As Boolean = True
While True
f = New dotnetApp.Form1
dotnetApp.myClass1.pLoop = ""
plp = ""
Dim myDB As Database
Dim myEd As Editor
Dim myPEO As Autodesk.AutoCAD.EditorInput.PromptPointOptions
myDB = AcadDoc.Database
myEd = AcadDoc.Editor
myPEO = New Autodesk.AutoCAD.EditorInput.PromptPointOptions(vbLf & "Select a dvk Point " + (PointArryListX.Count + 1).ToString() + ":")
myPEO.AllowNone = True
myPEO.UseBasePoint = False
Dim myPER As Autodesk.AutoCAD.EditorInput.PromptPointResult
Dim myPS As Autodesk.AutoCAD.EditorInput.PromptStatus
myPER = myEd.GetPoint(myPEO)
myPS = myPER.Status
Select Case myPS
Case Autodesk.AutoCAD.EditorInput.PromptStatus.OK
Dim picked As Point3d = myPER.Value
PointArryListX.Add(picked.X.ToString())
PointArryListY.Add(picked.Y.ToString())
MessageBox.Show("U picked a pt")
Case Autodesk.AutoCAD.EditorInput.PromptStatus.Cancel
MsgBox("You cancelled.")
Exit Sub
Case Autodesk.AutoCAD.EditorInput.PromptStatus.Error
MsgBox("Error warning.")
Exit Sub
Case Else
MessageBox.Show("not picked a pt")
Exit Sub
End Select
f.ShowDialog()
plp = dotnetApp.myClass1.pLoop
If plp = "y" Then
Series = dotnetApp.myClass1.txtSeries
Tag = dotnetApp.myClass1.txtTag
Width = dotnetApp.myClass1.txtWidth
Thick = dotnetApp.myClass1.txtThick
Height = dotnetApp.myClass1.txtHeight
Else
Exit While
End If
If PointArryListX.Count > 1 Then
Dim cnt As Integer
cnt = PointArryListX.Count
Dim cmd As String = " "
cmd = cmd + "_ca" + vbCr
cmd = cmd + PointArryListX.Item(cnt - 2) + vbCr
cmd = cmd + PointArryListY.Item(cnt - 2) + vbCr
cmd = cmd + PointArryListX.Item(cnt - 1) + vbCr
cmd = cmd + PointArryListY.Item(cnt - 1) + vbCr
cmd = cmd + Series + vbCr
cmd = cmd + Tag + vbCr
cmd = cmd + Width + vbCr
cmd = cmd + Thick + vbCr
cmd = cmd + Height + vbCr
cmd = cmd + "Ladder" + vbCr
cmd = cmd + "Tray_Type" + vbCr
acadApp.DocumentManager.MdiActiveDocument.SendStringToExecute(cmd, True, False, True)
acadApp.DocumentManager.MdiActiveDocument.SendStringToExecute("n" + vbCr, True, False, True)
End If
End While
my problem is
after selecting two points if i press on continue then the drawing is not generated
if press end then the drawing is generated
my requirement is
step1)prompt the user to pick the point
step2)show the dialog box and user enter all the details and clicks on conitnue
step3)prompt the user to pick the point
step4)show the dialog box and user enter all the details and clicks on conitnue
and a drawing is generated using the first two points
but this is not happening, this happens only if user clicks on end button and when the dialog box is closed
please help me