Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

29 lines (24 sloc) 1.082 kb
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' CircleFromLength.rvb -- May 2012
' If this code works, it was written by Dale Fugier.
' If not, I don't know who wrote it.
' Works with Rhino 4.0.
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Option Explicit
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Subroutine: CircleFromLength
' Purpose: Create a circle from a center point and a circumference.
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub CircleFromLength
Dim arrCenter, arrPlane, dblLength, dblRadius, strObject
arrCenter = Rhino.GetPoint("Center point of circle")
If IsArray(arrCenter) Then
arrPlane = Rhino.MovePlane(Rhino.ViewCPlane, arrCenter)
dblLength = Rhino.GetReal("Circle circumference")
If IsNumeric(dblLength) And (dblLength > 0.0) Then
dblRadius = dblLength / (2 * Rhino.PI)
strObject = Rhino.AddCircle(arrPlane, dblRadius)
Rhino.SelectObject strObject
End If
End If
End Sub
Jump to Line
Something went wrong with that request. Please try again.