When i draw a circle in vb.net, the radius property return a wrong value, here the code:
Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
Dim doc As Document = Application.DocumentManager.MdiActiveDocument
Dim db As Database = doc.Database
Dim tr As Transaction = db.TransactionManager.StartTransaction
Dim btr As BlockTableRecord = CType(tr.GetObject(db.CurrentSpaceId, OpenMode.ForWrite, 0, 0), BlockTableRecord)
Dim centro As New Point3d(20, 20, 0)
Dim circle As Circle = New Circle(centro, Vector3d.ZAxis, 5)
btr.AppendEntity(circle)
tr.AddNewlyCreatedDBObject(circle, True)
MsgBox("Radius=" & CType(circle.Radius, String))
tr.Commit()
tr.Dispose()
The circle´s radius is 5, but the property circle.radius look like this:
The circle in Autocad (v2015) show the right value, but by Vb.net return bad values.
What is wrong in my code ?
If the msgbox is after commit, the result is the same (with error)
tr.AddNewlyCreatedDBObject(circle, True)
tr.Commit()
MsgBox("Radius=" & CType(circle.Radius, String))
tr.Dispose()
I have new information:
The error occurs while I'm debugging.
When the program runs only in autocad returns correct values.
Im using VisualStudio 2013, with Autocad 2014 and 2015
Can't find what you're looking for? Ask the community or share your knowledge.