Difference between pages "GetClosestIndex MEL" and "IsSpace"

From scripting
(Difference between pages)
Jump to: navigation, search
(Created page with " global proc int GetClosestIndex(string $LocArr[], vector $XYZArr[], vector $CurVec, int $Skip[]) { //0001D LLC 2015 Nick Pisca float $WinDist = 1000000.0; int $WinInt =...")
 
(Created page with " Function IsSpace(Obj1 As Variant) As Boolean On Error GoTo Blast Dim HHH As ArcSpace Set HHH = Obj1 IsSpace = True Exit Function Blast: IsSpace = False End Function...")
 
Line 1: Line 1:
  global proc int GetClosestIndex(string $LocArr[], vector $XYZArr[], vector $CurVec, int $Skip[]) {
+
  Function IsSpace(Obj1 As Variant) As Boolean
//0001D LLC 2015 Nick Pisca
+
On Error GoTo Blast
float $WinDist = 1000000.0;
+
Dim HHH As ArcSpace
int $WinInt = -1;
+
Set HHH = Obj1
for ($x=0;$x<size($LocArr);$x++) {
+
IsSpace = True
if ([[IsInIntArray_MEL|IsInIntArray]]($Skip, $x) == 0) {
+
Exit Function
vector $Diff = $XYZArr[$x] - $CurVec;
+
Blast:
float $Dmag = mag($Diff);
+
IsSpace = False
if ($Dmag < $WinDist) {
+
  End Function
$WinDist = $Dmag;
 
$WinInt = $x;
 
}
 
}
 
}
 
return $x;
 
  }
 
  
  
  
''More information on strings and arrays, read pages 28-37 in [http://stores.lulu.com/nickpisca YSYT]. 
+
[[Category:CATIA DP VB]]
 
 
[[Category:MEL]]
 

Latest revision as of 07:03, 22 April 2017

Function IsSpace(Obj1 As Variant) As Boolean
On Error GoTo Blast
Dim HHH As ArcSpace
Set HHH = Obj1
IsSpace = True
Exit Function
Blast:
IsSpace = False 
End Function