The problem you're having is because you are not calling
Commit() on the transaction.
A Trasaction is aborted when you call Dispose() on it,
without previously calling Commit().
Aborting a transaction causes *all* changes to a database
that occured within the transaction to be undone, including
changes to the view.
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010
http://www.acadxtabs.com
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");
"Rune Aarnes" wrote in message
news:6292190@discussion.autodesk.com...
I use this to many different things for example I convert polyline, spline
or arc to polyline3d
I use AutoCAD 2008 and 2010. Same problem with both.
I have now found out that the sub TEST2 works find, but not TEST1
Public Sub TEST1()
Dim resEnt As PromptEntityResult
Dim ed As Editor =
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
Dim db As Database = ed.Document.Database
Dim tr As Transaction = db.TransactionManager.StartTransaction
Try
Do
resEnt = ed.GetEntity(vbNewLine & "Select polyline")
If resEnt.Status = PromptStatus.Cancel Then Exit Try
Loop While resEnt.Status <> PromptStatus.OK
Catch ex As System.Exception
MessageBox.Show(ex.Message, "System.Exception",
MessageBoxButtons.OK, MessageBoxIcon.Error)
Finally
tr.Dispose()
End Try
End Sub
Public Sub TEST2()
Dim resEnt As PromptEntityResult
Dim ed As Editor =
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
Dim db As Database = ed.Document.Database
'Dim tr As Transaction = db.TransactionManager.StartTransaction
Try
Do
resEnt = ed.GetEntity(vbNewLine & "Select polyline")
If resEnt.Status = PromptStatus.Cancel Then Exit Try
Loop While resEnt.Status <> PromptStatus.OK
Catch ex As System.Exception
MessageBox.Show(ex.Message, "System.Exception",
MessageBoxButtons.OK, MessageBoxIcon.Error)
Finally
'tr.Dispose()
End Try
End Sub
"jerrywinters" skrev i melding news:6291559@discussion.autodesk.com...
I tried your code. When I zoom in during the GetEntity, the view stays
where it is at when I select the next entity. What version of AutoCAD are
you running?
Also, you may want to do something other than the GoTo Statement. Perhaps
if you can describe what you are trying to accomplish, step by step, you can
get some better help.
Jerry