forked from mcneel/MOVED-rhinoscript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CircleFromLength.rvb
28 lines (24 loc) · 1.06 KB
/
CircleFromLength.rvb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' 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