Difference between revisions of "ReturnAllObjectsWithinDist"
From scripting
(Created page with " Function ReturnAllObjectsWithinDist(CurObj As Variant, ObjSet As HybridBody, WithinDist As Double) As Variant Dim tempArr() ReDim tempArr(0) If IsUpdatable(CurObj) = F...") |
(No difference)
|
Latest revision as of 19:53, 24 April 2017
Function ReturnAllObjectsWithinDist(CurObj As Variant, ObjSet As HybridBody, WithinDist As Double) As Variant Dim tempArr() ReDim tempArr(0) If IsUpdatable(CurObj) = False Then Exit Function End If Dim JMeas Set JMeas = TheSPAWorkbench.GetMeasurable(CurObj) Dim JDist As Double For X = 1 To ObjSet.HybridShapes.Count Dim Obj1 As HybridShape Set Obj1 = ObjSet.HybridShapes.Item(X) If IsUpdatable(Obj1) = True Then JDist = JMeas.GetMinimumDistance(Obj1) If JDist < WithinDist Then Set tempArr(UBound(tempArr)) = Obj1 ReDim Preserve tempArr(UBound(tempArr) + 1) End If End If Next X If UBound(tempArr) <> 0 Then ReDim Preserve tempArr(UBound(tempArr) - 1) End If ReturnAllObjectsWithinDist = tempArr End Function