VB.NET error in circle radius property

VB.NET error in circle radius property

Anonymous
Not applicable
841 Views
3 Replies
Message 1 of 4

VB.NET error in circle radius property

Anonymous
Not applicable

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:

radius.jpg

 

 

The circle in Autocad (v2015) show the right value, but by Vb.net return bad values.

 

What is wrong in my code ?

 

0 Likes
842 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Can you see the message box after tr.commit?
0 Likes
Message 3 of 4

Anonymous
Not applicable

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()

0 Likes
Message 4 of 4

Anonymous
Not applicable

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

0 Likes