Wednesday, 27 August 2008
AutoCAD Wishlist from AUGI
Whilst browsing the AUGI website our technical guys noticed a simple 'wish' for the next release of AutoCAD. The suggestion was to be able to draw a circle by entering a centre point and the known area.
Quite a simple request, so here is the Visual Basic code:
Sub circlearea()
Dim aCircle As AcadCircle
Dim PNT As Variant
Dim CAREA As Variant
Dim RAD As Variant
Dim pi As Double
pi = 3.14159265358979
PNT = ThisDrawing.Utility.GetPoint(, "Select centre point for circle:")
CAREA = ThisDrawing.Utility.GetReal("Area of circle:)
'calculate the required radius
RAD = Sqr(CAREA/pi)
Set aCircle = ThisDrawing.ModelSpace.AddCircle(PNT,RAD)
End Sub
If you have any suggestions or requests for routines to assist in your daily drafting and design then please contact our technical team.