.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

VB.NET error in circle radius property

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
578 Views, 3 Replies

VB.NET error in circle radius property

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 ?

 

3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: Anonymous

Can you see the message box after tr.commit?
Message 3 of 4
Anonymous
in reply to: Anonymous

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

Message 4 of 4
Anonymous
in reply to: Anonymous

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.

Post to forums  

Forma Design Contest


Autodesk Design & Make Report