Option Explicit
'-------------------------------------------------------------------------------
' Subroutine: MS Accesisible Urbanism for Port of Belgrade
' Purpose: distnace analysis within cloud of circles
' Author: Milutin Cerovic,Milica Samardzija 2009
' www.4ofseven.com
'--------------------------------------------------------------------------------
Call Main()
Sub Main()
Dim arrCloud1
Dim arrCloud2
Dim arrCircles1,arrCircles2
Dim dblDmax,dblDmin
Dim L
Dim i
arrCircles1=Rhino.GetObjects ("Select initial circles")
ReDim arrCloud1(UBound(arrCircles1))
arrCircles2=Rhino.GetObjects("Select reference circles")
ReDim arrCloud2(UBound(arrCircles2))
dblDmax = Rhino.GetReal("Enter Max distance")
dblDmin = Rhino.GetReal("Enter Min distance")
For i=0 To UBound(arrCircles1)
If Rhino.IsCircle(arrCircles1(i)) Then
arrCloud1(i)=Rhino.CircleCenterPoint(arrCircles1(i))
End If
Next
For i=0 To UBound(arrCircles2)
If Rhino.IsCircle(arrCircles2(i)) Then
arrCloud2(i)=Rhino.CircleCenterPoint(arrCircles2(i))
End If
Next
For Each obj In arrCloud1
For i=0 To UBound(arrcloud2)
L=Rhino.distance (arrcloud2(i),obj)
If L>dblDmin and L
Rhino.addline arrCloud2(i),obj
End If
Next
Next
End Sub
No comments:
Post a Comment