MZ@ !L!This program cannot be run in DOS mode. $PELDK!   3 @@ @3W@`  H.text  `.rsrc@0@@.reloc `@@B3HH( *( *s s s s *0 ~o *0 ~o *0 ~o *0 ~o *0 ( ( *0( *0 ( *0( *0 -(+**0 *( *0( { o -(+ { o *J( s } *( *0 rp( *0 rOp*0rsp*0*0( *(! *0rp*0rp*0rp*0rp*0rp*0rp*0rp*0rp**>~,**(" *0rp( *0r p*0%(!r)p rMp(# rsp(# rp(# rp(# rp(# r+p(# rp(# rp(# r>p(# rPp(# rp(# rp(# r6p(# rXp(# rp(# rp(# rp(# r p(# rBp(# rjp(# rtp(# rp(# rp(# rp(# rJp(# r^p(# rp(# rp(# rp(# rq p(# r( p(# rf p(# r p(# r3 p(# r, p(# r p(# r p(# r, p(# r p(# r p(# rjp(# r p(# rp(# rp(# rp(# rp(# rp(# rKp(# rYp(# rp(# rp(# rp(# rp(# rOp(# rp(# rp(# rop(# rp(# rOp(# rp(# rp(# rPp(# rp(# rJp(# r(p(# r0p(# rp(# rLp(# r(p(# rp(# rp(# rp(# rJp(# r;p(# r}p(# rJp(# rp(# rp(# rJp(# rp(# r7p(# rJp(# rQp(# rp(# rJp(# rp(# rp(# rJp(# rp(# rIp(# rJp(# rep(# rp(# rJp(# rp(# r p(# rJp(# rjp(# r%p(# r(p(# rp(# rUp(# rp(# rXp(# rp(# rp(# rEp(# rp(# rNp(# rJp(# rp(# r?p(# rp(# r p(# rvp(# rp(# rp(# rp(# rp(# r| p(# r p(# rL!p(# rj!p(# r~!p(# r!p(# r""p(# rz"p(# r"p(# r"p(# r#p(# rJp(# rV$p(# r$p(# rI%p(# r%p(# r%p(# r%&p(# rw&p(# r&p(# r'p(# rm'p(# r'p(# r (p(# rKp(# rjp(# r](p(# r(p(# r)p(# r6*p(# rl*p(# r*p(# rG+p(# r+p(# r+p(# r+p(# r#,p(# r,p(# ry-p(# r-p(# rN.p(# r'/p(# r/p(# r/p(# r70p(# r0p(# r1p(# r1p(# r92p(# r2p(# rN3p(# r3p(# r3p(# ry4p(# r5p(# rb5p(# r5p(# rc6p(# r6p(# rl7p(# r7p(# rq8p(# r8p(# r8p(# r;9p(# r9p(# r9p(# r:p(# r:p(# r:p(# r:p(# r=p(# r=p(# r5>p(# rz"p(# r"p(# r>p(# ri?p(# rz"p(# r"p(# r:@p(# r@p(# rAp(# rAp(# rAp(# r%Bp(# rAp(# rCp(# r Cp(# r,Cp(# r^Cp(# rCp(# rCp(# rDp(# rAEp(# rEp(# rEp(# rEp(# rIFp(# rFp(# rFp(# rGp(# rGp(# r-Gp(# rwGp(# rGp(# r Hp(# rIp(# rbIp(# rIp(# rEp(# rIp(# rLJp(# rJp(# rJp(# rKp(# rGp(# r"p(# r&Kp(# rdKp(# rGp(# rKp(# rLp(# rMp(# rkMp(# rEp(# rMp(# r Np(# riNp(# rJp(# rKp(# rGp(# r"p(# rNp(# rNp(# r-Op(# rOp(# r>Pp(# r"p(# rPp(# rSQp(# rRp(# r"p(# rp(# rRp(# rSp(# rwSp(# rSp(# rTp(# rTp(# r$Up(# rUp(# r+Vp(# rcVp(# rVp(# rWp(# rWp(# rWp(# rWp(# rJp(# rKp(# r$Xp(# rYp(# rTp(# r$Up(# rUp(# rYp(# rcVp(# rVp(# rWp(# rWp(# rWp(# rWp(# rJp(# rKp(# r:p(# r6Zp(# rZp(# r[p(# r+\p(# r\p(# r6]p(# r]p(# rYp(# r?^p(# r^p(# r_p(# rWp(# rWp(# rm_p(# rJp(# rKp(# r_p(# r&ap(# r\p(# r6]p(# r]p(# rYp(# r?^p(# r^p(# r_p(# rWp(# rWp(# rm_p(# rJp(# rKp(# r:p(# rGp(# r-Op(# rap(# rWbp(# rbp(# rbp(# r/cp(# rdp(# rdp(# r1ep(# rKp(# rep(# rGp(# rjp(# rrfp(# rfp(# rgp(# rgp(# rgp(# rChp(# rGp(# rhp(# r$ip(# rip(# rZjp(# rpjp(# rFp(# rjp(# rjp(# rjp(# rqkp(# rkp(# rbp(# rdp(# rkp(# r1ep(# r lp(# r'lp(# rqlp(# rlp(# rlp(# rWp(# rmp(# rJp(# rnp(# rnp(# rnp(# ryop(# rpp(# rppp(# rpp(# rlp(# rpp(# rWp(# rqp(# rrp(# rrp(# r tp(# r'tp(# r"p(# rPp(# rAtp(# rWbp(# rtp(# rbp(# rtp(# rup(# ryvp(# rvp(# rKp(# rwp(# rGp(# rjp(# rxp(# rfp(# rxp(# r/yp(# r{yp(# ryp(# rGp(# rzp(# rzp(# rO{p(# r{p(# rZjp(# r|p(# rFp(# rGp(# r|p(# rqkp(# rkp(# rbp(# rup(# ryvp(# rvp(# r lp(# r'lp(# rqlp(# rlp(# rn}p(# rWp(# r~p(# rJp(# r~p(# r=p(# rp(# r p(# rŀp(# rppp(# rpp(# rlp(# rp(# rWp(# rp(# rp(# r tp(# r'tp(# r"p(# rp(# r!p(# rp(# rp(# rɃp(# rKp(# rpp(# rp(# rʄp(# rp(# r8p(# rp(# rp(# rp(# rTp(# rp(# r'p(# rp(# rهp(# rp(# rp(# rp(# r@p(# rp(# rډp(# rp(# rp(# rp(# rQp(# r{p(# r p(# rXp(# rp(# rGp(# rp(# rˍp(# rp(# rԎp(# rp(# r"p(# rp(# r9p(# rp(# rݐp(# rp(# r[p(# rӑp(# rCp(# rp(# r4p(# r~p(# rӑp(# rp(# rp(# rNp(# rp(# rӑp(# rCp(# rp(# rԔp(# rppp(# r"p(# rFp(# rԎp(# rDp(# rvp(# rp(# rmp(# rԎp(# rϖp(# rp(# rЗp(# r p(# rԎp(# rjp(# rp(# rԎp(# rp(# rTp(# rԎp(# rp(# rp(# rԎp(# r<p(# rp(# rԎp(# rښp(# r8p(# rp(# rԛp(# rp(# rfp(# rp(# rKp(# rSp(# rp(# rp(# r)p(# r7p(# rp(# r͞p(# rp(# rԎp(# rğp(# rp(# r(p(# rp(# rp(# rep(# rKp(# r:p(# r"p(# rp(# r p(# rjp(# rp(# rp(# rp(# rKp(# rp(# rp(# rp(# rKp(# rp(# r8p(# rbp(# r#p(# rQp(# rp(# rp(# rGp(# rp(# rjp(# rp(# rp(# rԦp(# r(p(# rvp(# rʧp(# rp(# rnp(# r Cp(# rp(# r]p(# rp(# rp(# rOp(# rKp(# rp(# rϪp(# r=p(# rp(# rp(# rϫp(# r3p(# rwp(# rKp(# rp(# rp(# rMp(# rKp(# rڭp(# rp(# r|p(# rp(# rKp(# r2p(# rhp(# rدp(# rTp(# rKp(# rp(# r"p(# rnp(# rp(# ryp(# rp(# rղp(# rp(# r p(# rԳp(# rp(# rhp(# r´p(# rԎp(# rp(# r0p(# rϵp(# rp(# rmp(# rp(# r p(# r,p(# r۷p(# rp(# ryp(# rp(# rZp(# rp(# rp(# rp(# rp(# rɺp(# r%p(# rcp(# rp(# r[p(# rp(# rCp(# rp(# rp(# r~p(# rp(# rp(# rp(# rڼp(# rp(# rp(# rCp(# rp(# r<p(# rppp(# rp(# rFp(# rp(# rDp(# rp(# rp(# rp(# rԎp(# rp(# r?p(# r$p(# rvp(# rԎp(# rp(# rp(# rԎp(# r`p(# rp(# rԎp(# rp(# rRp(# rԎp(# rp(# rp(# rԎp(# rBp(# rp(# rp(# rp(# rp(# r0p(# rNp(# rKp(# rSp(# r-p(# rqp(# r)p(# rp(# r+p(# rQp(# rp(# rԎp(# rğp(# rp(# rPp(# rp(# rp(# rep(# rKp(# r:p(# r"p(# r3p(# rYp(# rjp(# rp(# rp(# rp(# rKp(# rp(# rp(# rp(# rKp(# rp(# rp(# r%p(# rp(# rp(# rvp(# rp(# rp(# rnp(# rjp(# rp(# rp(# rp(# rp(# rWp(# rp(# rp(# rUp(# rKp(# rp(# rJp(# r~p(# rp(# rBp(# rKp(# rp(# rp(# r2p(# rp(# rp(# rp(# r,p(# rrp(# rKp(# rp(# rp(# rJp(# rKp(# rp(# r p(# r}p(# rp(# rKp(# r7p(# rmp(# rp(# rYp(# rp(# rp(# rp(# r[p(# rp(# r p(# r+p(# r:p(# rGp(# rKp(# rip(# rp(# rp(# rp(# rp(# rp(# rp(# rp(# rIp(# rJp(# rKp(# rp(# rp(# ($ o% &*BSJB v2.0.50727l#~\#StringsL#US@#GUIDP|#BlobW 3! %''   N0^W 4W W-':g7ZDsD  !V9kWW 4HUWcjkk)7:7 E7 O ] x-  1"1y 1-1:1G!P *X *` e l ( 5 B Fc!F(h!9l4!FAqH!Jxd!h!*!|!*!*!F !Fq"Fq"FK,"FZh@"*H"F~q\"Fqp"Fq"Fq"Fq"Fq"Fq"Fq"e"#*#F$#Fq8#F1&__< *****$*,*4*<*$|,|4|<|***gc(h)tAq**DLL L**9*A*ZhY*a*\5t;}@*L *)!.;Z.3Q@+@CCI?cci2+s{S++#++ + #s@+@`+`+++++ lp{)0p)FNOTY^  uu   W ]]]-- mscorlibMicrosoft.VisualBasicMyApplicationMyMyComputerMyProjectMyWebServicesThreadSafeObjectProvider`1MonkeyScriptWrapperPluginPlugInAttributesLibraryLoader_ebb1d407_d813_4499_949a_2b5c412d026aTheOrcaOffsetTableCommandMicrosoft.VisualBasic.ApplicationServicesApplicationBase.ctorMicrosoft.VisualBasic.DevicesComputerSystemObject.cctorget_Computerm_ComputerObjectProviderget_Applicationm_AppObjectProviderUserget_Userm_UserObjectProviderget_WebServicesm_MyWebServicesObjectProviderApplicationWebServicesEqualsoGetHashCodeTypeGetTypeToStringCreate__Instance__TinstanceDispose__Instance__get_GetInstanceMicrosoft.VisualBasic.MyServices.InternalContextValue`1m_ContextGetInstanceRhino_DotNetRMA.RhinoMRhinoUtilityPlugInGuidPlugInIDPlugInNamePlugInVersionIRhinoPlugInplugin_load_timePlugInLoadTimeOnLoadPlugInMRhinoPlugInAttributesAddressCountryEmailFaxOrganizationPhoneUpdateURLWebsitem_LoadedLoadLibrariesMRhinoScriptCommandCommandUUIDEnglishCommandNameIRhinoCommandresultIRhinoCommandContextRunCommandcontextSystem.ComponentModelEditorBrowsableAttributeEditorBrowsableStateSystem.CodeDom.CompilerGeneratedCodeAttributeSystem.DiagnosticsDebuggerHiddenAttributeMicrosoft.VisualBasic.CompilerServicesStandardModuleAttributeHideModuleNameAttributeSystem.ComponentModel.DesignHelpKeywordAttributeSystem.Runtime.CompilerServicesRuntimeHelpersGetObjectValueRuntimeTypeHandleGetTypeFromHandleActivatorCreateInstanceMyGroupCollectionAttributeget_Valueset_ValueSystem.Runtime.InteropServicesComVisibleAttributeMRhinoPlugInStringConcatRhUtilMRhinoAppRhinoAppRunScriptCompilationRelaxationsAttributeRuntimeCompatibilityAttributeOrca3DOffsetTableOrca3DOffsetTable.dllM{ebb1d407-d813-4499-949a-2b5c412d026a}#Orca3DOffsetTable 1.0.6c160 Sallitt Dr, Suite 200, Stevensville, MD 21666USA%support@orca3d.com{DRS Defense Solutions, LLC, Advanced Marine Technology Center+http://www.orca3d.comM{d3567940-4da0-498a-90c3-86a33efcde89}OrcaOffsetTable#! -_RunScript ( %'Option Explicit !Dim successful -On Error Resume Next =Call OffsetTable(successful) )If Successful Then Rhino.Messagebox "Offset Table Complete",,"Orca3D Offset Table" Else } Rhino.Messagebox "Error Encountered",,"Orca3D Offset Table" End If ;Sub OffsetTable(successful) g 'Copyright 2008-2010, DRS Defense Solutions, LLC A 'Lead Programmer: Thomas Hays ! 'Version 1.06 ' 'August 12, 2008 7 'Revised: April 19, 2010 7 'Revised: April 22, 2010 / On Error Resume Next ! Dim orcaFound ' orcaFound = True # Dim orcaPlugIn g Set orcaPlugIn = Rhino.GetPluginObject("Orca3D")  If err Then + orcaFound = False  End If ' successful=False Dim arrItems(2), arrModes(2), arrItems2(1), arrModes2(1), intResult Dim NumberOfCurves, NumberOfStations, NumberOfButtocks, NumberOfWaterlines, NumberOf3DCurves Dim arrXaxis, arrYaxis, arrZaxis, arrplane 'unit vectors for each axis  Dim arrAllCurves, arrCurves, arrStations(), arrButtocks(),arrWaterlines(),arr3DCurves() = Dim StrObject, StrObject2  Dim i,j,k,a Dim arrXvalue(), arrYvalue(), arrZvalue() 'holds the constant value for each curve  Dim arrStartPoint 'holds the coordinates of a point on the curve, used to construct a plane to determine the curve type k Dim dblHolder, strCurveHolder 'for the bubble sort G Dim arrIntersectB, arrIntersectW K Dim ButtockHeights, WLHalfBreadths ] Dim NumberOfButtockHts, NumberOfWaterlineHB ' Dim ButtockPrint / Dim Longl,Trans,Vert ! 'Initialize  NumberOfCurves = 0 'sets the default number of curves to zero / NumberOfStations = 0 / NumberOfButtocks = 0 3 NumberOfWaterlines = 0 / NumberOf3DCurves = 0 % Dim updirection ' Dim fwddirection ) Dim stardirection - If (orcaFound) Then O Dim vectorup, vectorfwd, vectorstbd M Set vectorup = orcaPlugin.UpVector w updirection = Array(vectorup.x, vectorup.y, vectorup.z) Y Set vectorfwd = orcaPlugin.ForwardVector  fwddirection = Array(vectorfwd.x, vectorfwd.y, vectorfwd.z) _ Set vectorstbd = orcaPlugin.StarboardVector stardirection = Array(vectorstbd.x, vectorstbd.y, vectorstbd.z)  Else g updirection = Rhino.VectorUnitize(Array(0,0,1)) k fwddirection = Rhino.VectorUnitize(Array(-1,0,0)) k stardirection = Rhino.VectorUnitize(Array(0,1,0))  arrXaxis = Array(fwddirection(0),fwddirection(1),fwddirection(2)) arrYaxis = Array(stardirection(0),stardirection(1),stardirection(2)) arrZaxis = Array(updirection(0),updirection(1),updirection(2))  A If(fwddirection(0) <> 0) Then  Longl = 0 A If(fwddirection(1) <> 0) Then  Longl = 1 A If(fwddirection(2) <> 0) Then  Longl = 2 ? If(updirection(0) <> 0) Then  Vert = 0 ? If(updirection(1) <> 0) Then  Vert = 1 ? If(updirection(2) <> 0) Then  Vert = 2 C If(stardirection(0) <> 0) Then  Trans = 0 C If(stardirection(1) <> 0) Then  Trans = 1 C If(stardirection(2) <> 0) Then  Trans = 2 / 'Select the curves { arrItems(0) = "Include all Curves" : arrModes(0) = 2 arrItems(1) = "Include Orca3D Curves Only" : arrModes(1) = 0 arrItems(2) = "Select Curves to include" : arrModes(2) = 0 g intResult = Rhino.PopupMenu(arrItems, arrModes)  arrItems2(0) = "Include all Curves" : arrModes2(0) = 2 arrItems2(1) = "Select Curves to include" : arrModes2(1) = 0 k intResult = Rhino.PopupMenu(arrItems2, arrModes2) If (intResult = 0) Then 'Select all of the curves in the model O arrCurves = Rhino.ObjectsByType (4) ElseIf (orcaFound And intResult = 1) Then 'Select only Orca3D curves U arrAllCurves = Rhino.ObjectsByType (4) 5 NumberOfOrcaCurves = 0 S ReDim arrCurves(UBound(arrAllCurves)) For i=0 To UBound(arrAllCurves) 'cull the Orca3D sections from the list of all curves ? strObject= arrAllCurves(i) If Rhino.ObjectDescription (strObject)= "Orca3D section" Then c NumberOfOrcaCurves = NumberOfOrcaCurves + 1 k arrCurves(NumberOfOrcaCurves-1)=arrAllCurves(i)  End If  Next e ReDim Preserve arrCurves(NumberOfOrcaCurves-1) = If IsNull (arrCurves) Then W Rhino.Messagebox "No Orca3D Sections."  Exit Sub  End If  ElseIf ((orcaFound And intResult = 2) Or (Not orcaFound And intResult = 1)) Then 'prompt the user to select the curves to be included  arrCurves = Rhino.GetObjects ("Select the curves to be included.", 4) 'arrCurves = Rhino.ObjectsByType (4) 'Select all of the curves in the model S 'ReDim arrCurves(UBound(arrAllCurves)) M 'If IsNull(arrCurves) Then Exit Sub ; If IsArray(arrCurves) Then Q ReDim arrStations(UBound(arrCurves)) Q ReDim arrButtocks(UBound(arrCurves)) U ReDim arrWaterlines(UBound(arrCurves)) Q ReDim arr3DCurves(UBound(arrCurves)) M ReDim arrXvalue(UBound(arrCurves)) M ReDim arrYvalue(UBound(arrCurves)) M ReDim arrZvalue(UBound(arrCurves)) S ReDim arrEndPoints(UBound(arrCurves)) 'Find the total number of curves, and the number of each type.  'Put the curves into arrays by type, and create arrays with the constant value  'of each curve (e.g. X value for the stations), so that the curves can be sorted 5 'into ascending order.  For Each StrObject In arrCurves 'Adds 1 for each curve selected Q NumberOfCurves = NumberOfCurves + 1 W If Rhino.isCurvePlanar(StrObject) Then  m arrStartPoint = Rhino.CurveStartPoint(StrObject) arrplane = Rhino.PlaneFromFrame (arrStartPoint, arrYaxis, arrZaxis) 'station plane  If Rhino.IsCurveInPlane(StrObject, arrplane) Then ' it's a station E 'Add curve to station array  NumberOfStations = NumberOfStations + 1 'adds to station number  arrStations(NumberOfStations-1) = arrCurves(NumberOfCurves-1) 'places the curve in the station array y arrXvalue(NumberOfStations-1) = arrStartPoint(Longl) / e Else 'check to see if it's a buttock  arrplane = Rhino.PlaneFromFrame (arrStartPoint, arrXaxis, arrZaxis) 'buttock plane  If Rhino.IsCurveInPlane(StrObject, arrplane) Then ' it's a buttock G 'Add curve to buttock array _ NumberOfButtocks = NumberOfButtocks + 1 arrButtocks(NumberOfButtocks-1) = arrCurves(NumberOfCurves-1) { arrYvalue(NumberOfButtocks-1) = arrStartPoint(Trans) i ' Else arrplane = Rhino.PlaneFromFrame (arrStartPoint, arrXaxis, arrYaxis) If Rhino.IsCurveInPlane(StrObject, arrplane) Then ' it's a waterline M 'Add curve to waterline array i NumberOfWaterlines = NumberOfWaterlines + 1 arrWaterlines(NumberOfWaterlines-1) = arrCurves(NumberOfCurves-1)  arrZvalue(NumberOfWaterlines-1) = arrStartPoint(Vert)  Else 'it's planar, but not a station, buttock, or waterline a NumberOf3DCurves = NumberOf3DCurves + 1 arr3DCurves(NumberOf3DCurves-1) = arrCurves(NumberOfCurves-1) G End If 'check for waterline A End If 'check for buttock ? End If 'check for station e Else ' it's a 3D curve (non-planar) [ NumberOf3DCurves = NumberOf3DCurves + 1 arr3DCurves(NumberOf3DCurves-1) = arrCurves(NumberOfCurves-1)  End If ) Next 'next curve ) Dim Proceed Proceed = Rhino.MessageBox("Number of stations selected: " & NumberOfStations & VbCrLf & "Number of buttocks selected: " & NumberOfButtocks & VbCrLf & "Number of waterlines selected: " & NumberOfWaterlines & VbCrLf & "Number of 3D curves selected: " & NumberOf3DCurves & VbCrLf & VbCrLf &"Create Excel Offset Table?", 4, "Orca3D Offset Table") A If Proceed = 7 Then Exit Sub A If NumberofStations < 1 Then Rhino.MessageBox "Number of Stations must be >=1",48,"Orca3D Offset Table" If NumberofButtocks + NumberofWaterlines + Numberof3DCurves < 1 Then Rhino.MessageBox "Must have at least one Buttock, Waterline, or 3D Curve",48,"Orca3D Offset Table" i If NumberOfButtocks + NumberOf3DCurves > 24 Then Rhino.MessageBox "Number of Buttocks + Number of 3D Curves must not exceed 24",48,"Orca3D Offset Table"  Exit Sub  End If m If NumberOfWaterlines + NumberOf3DCurves > 24 Then Rhino.MessageBox "Number of Waterlines + Number of 3D Curves must not exceed 24",48,"Orca3D Offset Table"  End If 1 'Now sort the curves [ For i = (NumberOfStations-1) To 1 Step -1 5 For a = 0 To (i - 1)  If arrXvalue(a) > arrXvalue(a + 1) Then ' If the element is greater than the element following it, exchange the two elements. G dblHolder = arrXvalue(a + 1) M arrXvalue(a + 1) = arrXvalue(a) ? arrXvalue(a) = dblHolder # U strCurveHolder = arrStations(a + 1) U arrStations(a + 1) = arrStations(a) M arrStations(a) = strCurveHolder  End If  Next  Next I If NumberofButtocks Then ] For i = (NumberOfButtocks-1) To 1 Step -1 7 For a = 0 To (i - 1)  If arrYvalue(a) > arrYvalue(a + 1) Then ' If the element is greater than the element following it, exchange the two elements. I dblHolder = arrYvalue(a + 1) O arrYvalue(a + 1) = arrYvalue(a) A arrYvalue(a) = dblHolder W strCurveHolder = arrButtocks(a + 1) W arrButtocks(a + 1) = arrButtocks(a) O arrButtocks(a) = strCurveHolder  End If  Next = If NumberofWaterlines Then a For i = (NumberOfWaterlines-1) To 1 Step -1  If arrZvalue(a) > arrZvalue(a + 1) Then ' If the element is greater than the element following it, exchange the two elements. I dblHolder = arrZvalue(a + 1) O arrZvalue(a + 1) = arrZvalue(a) A arrZvalue(a) = dblHolder [ strCurveHolder = arrWaterlines(a + 1) _ arrWaterlines(a + 1) = arrWaterlines(a) S arrWaterlines(a) = strCurveHolder / 'end of bubble sort ? 'Now find the intersections a If NumberofButtocks Or Numberof3DCurves Then ReDim NumberOfButtockHts(NumberOfStations-1, NumberOfButtocks+NumberOf3DCurves-1)  ReDim ButtockHeights(NumberOfStations-1, NumberOfButtocks+NumberOf3DCurves-1,3,2) e If NumberofWaterlines Or Numberof3DCurves Then ReDim NumberOfWaterlineHB(NumberOfStations-1, NumberOfWaterlines+NumberOf3DCurves-1)  ReDim WLHalfBreadths(NumberOfStations-1, NumberOfWaterlines+NumberOf3DCurves-1,3,2) W For i = 0 To NumberOfStations-1 Step 1 c If NumberofButtocks Or Numberof3DCurves Then K 'get all of the buttock heights [ For j = 0 To NumberOfButtocks-1 Step 1  arrIntersectB = Rhino.CurveCurveIntersection (arrStations(i), arrButtocks(j)) Y If IsArray(arrIntersectB) Then NumberOfButtockHts(i,j) = (UBound(arrIntersectB,1)-LBound(arrIntersectB,1)+1) Y For a = 0 To UBound(arrIntersectB,1) 7 'orientation 0,1,2 [ ButtockHeights(i,j,a,0)=arrXvalue(i) [ ButtockHeights(i,j,a,1)=arrYvalue(j) ButtockHeights(i,j,a,2)=arrIntersectB(a,1)(Vert)  Next  Else G NumberOfButtockHts(i,j) = 0 For j = NumberOfButtocks To NumberOfButtocks + NumberOf3DCurves-1 Step 1 'get the heights of 3D curve intersections  arrIntersectB = Rhino.CurveCurveIntersection (arrStations(i), arr3DCurves(j-NumberOfButtocks)) O 'orientation 0,1,2 m If NumberofWaterlines Or Numberof3DCurves Then [ 'get all of the waterline half-breadths ) For k = 0 To NumberOfWaterlines-1 Step 1 'for every station, the intersection point with a waterline is placed in the arrIntersectW array  arrIntersectW = Rhino.CurveCurveIntersection (arrStations(i), arrWaterlines(k)) Y If IsArray(arrIntersectW) Then NumberOfWaterlineHB(i,k) = (UBound(arrIntersectW,1)-LBound(arrIntersectW,1)+1) Y For a = 0 To UBound(arrIntersectW,1) [ WLHalfBreadths(i,k,a,0)=arrXvalue(i) u WLHalfBreadths(i,k,a,1)=arrIntersectW(a,1)(Trans) [ WLHalfBreadths(i,k,a,2)=arrZvalue(k) I NumberOfWaterlineHB(i,k) = 0 m For k = NumberOfWaterlines To NumberOfWaterlines+NumberOf3DCurves-1 Step 1 'for every station, the intersection point with a waterline is placed in the arrIntersectW array  arrIntersectW = Rhino.CurveCurveIntersection (arrStations(i), arr3DCurves(k-NumberOfWaterlines)) ] 'Now print out a table of Buttock Heights a 'Find the total number of rows in the table + TotalPrintRows=0 I For i = 0 To NumberOfStations-1  'Find the max number of buttock intersections at this station; this is the number of print rows for this station  NumberOfPrintRows = NumberOfButtockHts(i,0) 'start with the first buttock q For j=0 To NumberOfButtocks + NumberOf3DCurves - 1  If NumberOfButtockHts(i,j) > NumberOfPrintRows Then NumberOfPrintRows=NumberOfButtockHts(i,j) u TotalPrintRows = TotalPrintRows + NumberOfPrintRows e 'Put the data in the ButtockPrint table array 5 'First the Header Row  ReDim ButtockPrint (TotalPrintRows,NumberOfButtocks + NumberOf3DCurves + 1) G ButtockPrint (0,0) = "Station" E For i = 1 To NumberOfButtocks Q ButtockPrint(0,i) = arrYValue(i-1)  For i=NumberOfButtocks + 1 To NumberOfButtocks + NumberOf3DCurves If Rhino.Objectname(arr3DCurves(i-NumberOfButtocks-1)) <> Empty Then  ButtockPrint(0,i) = Rhino.Objectname(arr3DCurves(i-NumberOfButtocks-1))  Else E ButtockPrint(0,i) = "Curve"   Next ButtockPrint (0,NumberOfButtocks + NumberOf3DCurves + 1) = "Station" / 'Now the data rows  PrintRow=0 K For j=0 To NumberOfButtocks - 1  Next I For a = 1 To NumberOfPrintRows = PrintRow = PrintRow + 1 ) If a = 1 Then ButtockPrint (PrintRow ,0) = ArrXvalue(i) 'put the station value in column 0  ButtockPrint (PrintRow ,0) = " " 'don't repeat the station value  For j = 0 To NumberOfButtocks + NumberOf3DCurves - 1 U If NumberOfButtockHts(i,j)>=a Then ButtockPrint (PrintRow,j+1) = (ButtockHeights(i,j,a-1,2))  Else 'This buttock does not have an intersection, so just put in blanks U ButtockPrint (PrintRow,j+1) = " "  End If  Next 'j  ButtockPrint (PrintRow ,NumberOfButtocks + NumberOf3DCurves + 1) = ArrXvalue(i) 'put the station value in the last column  ButtockPrint (PrintRow ,NumberOfButtocks + NumberOf3DCurves + 1) = " " 'don't repeat the station value  End If [ 'Rhino.MessageBox("station: " & i & VbCrLf & "PrintRow " & PrintRow & VbCrLf & "Number of Print Rows for this buttock: " & NumberOfPrintRows & VbCrLf & "a: " & a)  Next 'a  Next 'i m 'Now print out a table of Waterline Half Breadths / TotalPrintRowsWL=0 'Find the max number of waterline intersections at this station; this is the number of print rows for this station  NumberOfPrintRows = NumberOfWaterlineHB(i,0) 'start with the first waterline O For j=0 To NumberOfWaterlines - 1  If NumberOfWaterlineHB(i,j) > NumberOfPrintRows Then NumberOfPrintRows=NumberOfWaterlineHB(i,j) } TotalPrintRowsWL = TotalPrintRowsWL + NumberOfPrintRows i 'Put the data in the WaterlinePrint table array  ReDim WaterlinePrint (TotalPrintRowsWL,NumberOfWaterlines+ NumberOf3DCurves +1) K WaterlinePrint (0,0) = "Station" I For i = 1 To NumberOfWaterlines U WaterlinePrint(0,i) = arrZValue(i-1)  For i= NumberOfWaterlines +1 To NumberOfWaterlines + NumberOf3DCurves 'rhino.messagebox Rhino.Objectname(arr3DCurves(i-NumberOfWaterlines-1))  If Rhino.Objectname(arr3DCurves(i-NumberOfWaterlines-1)) <> Empty Then  WaterlinePrint(0,i)= Rhino.Objectname(arr3DCurves(i-NumberOfWaterlines-1)) I WaterlinePrint(0,i) = "Curve" WaterlinePrint (0,NumberOfWaterlines+NumberOf3DCurves+1) = "Station" WaterlinePrint (PrintRow ,0) = ArrXvalue(i) 'put the station value in column 0  WaterlinePrint (PrintRow ,0) = " " 'don't repeat the station value  For j = 0 To NumberOfWaterlines+ NumberOf3DCurves - 1 W If NumberOfWaterlineHB(i,j)>=a Then WaterlinePrint (PrintRow,j+1) = (WLHalfBreadths(i,j,a-1,1))  Else 'This waterline does not have an intersection, so just put in blanks Y WaterlinePrint (PrintRow,j+1) = " " WaterlinePrint (PrintRow ,NumberOfWaterlines+ NumberOf3DCurves +1) = ArrXvalue(i) 'put the station value in column 0  WaterlinePrint (PrintRow ,NumberOfWaterlines+ NumberOf3DCurves +1) = " " 'don't repeat the station value # End If i 'Now Open Excel and put the data into worksheets % ' Launch Excel  Dim app Set app = CreateObject("Excel.Application") 'how do we check for failure here? + ' Make it visible - app.Visible = True m 'app.ReferenceStyle = -4150 'change to R1C1 format a ' Add a new workbook for the Buttock Heights  Dim wb ? Set wb = app.workbooks.add c If NumberofButtocks Or NumberOf3DCurves Then ; If TotalPrintRows Then wb.Sheets(1).Select 'i.e. "Sheet1" in English or "Hoja1" in Spanish W wb.Sheets(1).Name = "Buttock Heights" Y 'Declare a range object for the header ' Dim headerrng Set headerrng = wb.Activesheet.Range("A1").Resize(1,NumberOfButtocks+NumberOf3DCurves+2) + headerrng.merge S headerrng.value = "BUTTOCK HEIGHTS" W headerrng.HorizontalAlignment = -4108 A headerrng.Font.Bold = True ) Dim StaColumn1 Set StaColumn1 = wb.Activesheet.Range("A2").Resize(TotalPrintRows+2,1) E StaColumn1.Font.Bold = True k StaColumn1.HorizontalAlignment = -4108 ) Dim StaColumn2 ColumnLetter = ChrW(NumberOfButtocks + NumberOf3DCurves + 1 + 65) K ColumnLetter = ColumnLetter&"2" Set StaColumn2 = wb.Activesheet.Range(ColumnLetter).Resize(TotalPrintRows+2,1) C StaColumn2.Font.Bold = True Y StaColumn2.HorizontalAlignment = -4108 ) Dim ButtockRow Set ButtockRow = wb.Activesheet.Range("B2").Resize(2, NumberOfButtocks+NumberOf3DCurves+2) E ButtockRow.Font.Bold = True  3 Dim buttocklabelrng Set buttocklabelrng = wb.Activesheet.Range("B2").Resize(1,NumberOfButtocks+NumberOf3DCurves) O buttocklabelrng.value = "Buttock" c buttocklabelrng.HorizontalAlignment = -4108 ? If NumberOf3DCurves Then 7 Dim buttocklabelrng2 E For i=1 To NumberOf3DCurves w If Rhino.Objectname(arr3DCurves(i-1)) <> Empty Then o ColumnLetter = ChrW(i + NumberOfButtocks + 65) Q ColumnLetter = ColumnLetter&"2" Set buttocklabelrng2 = wb.Activesheet.Range(ColumnLetter).Resize(1,1) I buttocklabelrng2.value = "" } 'go down one row, and set the cell to center the text Q ColumnLetter = ColumnLetter&"3" k buttocklabelrng2.HorizontalAlignment = -4108  Else M buttocklabelrng2.value = "3D" ! Next 1 'border formatting / Dim UnderScorerng Set UnderScorerng = wb.Activesheet.Range("A3").Resize(1,NumberOfButtocks+NumberOf3DCurves+2) a UnderScorerng.Borders(9).linestyle = -4119 % Dim Totalrng Set Totalrng = wb.Activesheet.Range("A1").Resize(TotalPrintRows+3,NumberOfButtocks+NumberOf3DCurves+2) O Totalrng.Borders(7).linestyle = 1 I Totalrng.Borders(7).Weight = 4 O Totalrng.Borders(8).linestyle = 1 I Totalrng.Borders(8).Weight = 4 O Totalrng.Borders(9).linestyle = 1 I Totalrng.Borders(9).Weight = 4 Q Totalrng.Borders(10).linestyle = 1 K Totalrng.Borders(10).Weight = 4 Q headerrng.Borders(9).linestyle = 1 K headerrng.Borders(9).Weight = 4 ] StaColumn1.Borders(10).linestyle = -4119 [ StaColumn2.Borders(7).linestyle = -4119 ? 'end of border formatting 1 _ ' Declare a range object to hold our data  Dim rng Set rng = wb.Activesheet.Range("A3").Resize(TotalPrintRows+1,NumberOfButtocks+NumberOf3DCurves+2) U ' Now assign them all in one shot... = rng.value = ButtockPrint A rng.NumberFormat = "0.000" q 'auto fits the two title rows of the buttock table # Dim autorng Set autorng = wb.Activesheet.Range("A2").Resize(2,NumberOfButtocks+NumberOf3DCurves+2) ; autorng.Columns.AutoFit 9 'Shade every other row ) Startcol = "A" Endcol = ChrW(NumberOfButtocks+ NumberOf3DCurves + 1 + 65) U For i=4 To TotalPrintRows + 3 Step 2 a shaderange = Startcol & i &":"&Endcol & i wb.ActiveSheet.Range(shaderange).Interior.ColorIndex = 15 # Dim extrarows ] Set extrarows = wb.ActiveSheet.Range("A1") ? 'add in the new rows on top = extrarows.EntireRow.Insert O 'create the borders of the new rows ) Dim Newheaderrng Set Newheaderrng = wb.Activesheet.Range("A1").Resize(1,NumberOfButtocks+NumberOf3DCurves+2) - Newheaderrng.merge W Newheaderrng.value = "TABLE OF OFFSETS" Y Newheaderrng.HorizontalAlignment = -4108 C Newheaderrng.Font.Bold = True S Newheaderrng.Borders(9).linestyle = 1 M Newheaderrng.Borders(9).Weight = 4 ) Dim Newborderrng Set Newborderrng = wb.Activesheet.Range("A1").Resize(6,NumberOfButtocks+NumberOf3DCurves+2) S Newborderrng.Borders(7).linestyle = 1 M Newborderrng.Borders(7).Weight = 4 S Newborderrng.Borders(8).linestyle = 1 M Newborderrng.Borders(8).Weight = 4 U Newborderrng.Borders(10).linestyle = 1 O Newborderrng.Borders(10).Weight = 4 'Prints the file name, units, and absolute tolerance for the buttock table 1 Dim PrintfileNamerng k Set PrintfileNamerng = wb.ActiveSheet.Range("A3") S PrintfileNamerng.value = "File Name:" K PrintfileNamerng.Font.Bold = True 3 Dim PrintfileNamerng2 m Set PrintfileNamerng2 = wb.ActiveSheet.Range("D3") g PrintfileNamerng2.value = Rhino.DocumentName () ) Dim PrintUnitrng c Set PrintUnitrng = wb.ActiveSheet.Range("A4") C PrintUnitrng.value = "Units:" C PrintUnitrng.Font.Bold = True + Dim PrintUnitrng2 e Set PrintUnitrng2 = wb.ActiveSheet.Range("D4") PrintUnitrng2.value = Rhino.UnitSystemName (True , False , False) 3 Dim PrintTolerancerng m Set PrintTolerancerng = wb.ActiveSheet.Range("A5") g PrintTolerancerng.value = "Absolute Tolerance:" M PrintTolerancerng.Font.Bold = True 5 Dim PrintTolerancerng2 o Set PrintTolerancerng2 = wb.ActiveSheet.Range("D5") { PrintTolerancerng2.value = Rhino.UnitAbsoluteTolerance () e PrintTolerancerng2.HorizontalAlignment = -4131 g If NumberofWaterlines Or Numberof3DCurves Then K If TotalPrintRowsWL Then s 'Switch to a new worksheet for the WL Half Breadths  wb.Sheets(2).Select 'i.e. "Sheet2" in English or "Hoja2" in Spanish [ wb.Sheets(2).Name = "WL Half-Breadths"  ) Dim headerrng2 Set headerrng2 = wb.Activesheet.Range("A1").Resize(1,NumberOfWaterlines+ NumberOf3DCurves +2) - headerrng2.merge e headerrng2.value = "WATERLINE HALF-BREADTHS" Y headerrng2.HorizontalAlignment = -4108 C headerrng2.Font.Bold = True ) Dim StaColumn3 Set StaColumn3 = wb.Activesheet.Range("A2").Resize(TotalPrintRowsWL+2,1) C StaColumn3.Font.Bold = True Y StaColumn3.HorizontalAlignment = -4108 ) Dim StaColumn4 ColumnLetter = ChrW(NumberOfWaterlines+ NumberOf3DCurves + 1 + 65) Set StaColumn4 = wb.Activesheet.Range(ColumnLetter).Resize(TotalPrintRowsWL+2,1) C StaColumn4.Font.Bold = True Y StaColumn4.HorizontalAlignment = -4108  Dim WLRow Set WLRow = wb.Activesheet.Range("B2").Resize(2, NumberOfWaterlines+ NumberOf3DCurves +2) 9 WLRow.Font.Bold = True ) Dim wllabelrng Set wllabelrng = wb.Activesheet.Range("B2").Resize(1,NumberOfWaterlines+Numberof3DCurves) I wllabelrng.value = "Waterline" [ wllabelrng.HorizontalAlignment = -4108 = If NumberOf3DCurves Then - Dim wllabelrng2 s ColumnLetter = ChrW(i + NumberOfWaterlines + 65) Set wllabelrng2 = wb.Activesheet.Range(ColumnLetter).Resize(1,1) ? wllabelrng2.value = "" a wllabelrng2.HorizontalAlignment = -4108 C wllabelrng2.value = "3D"  Next  1 Dim UnderScorerng2 Set UnderScorerng2 = wb.Activesheet.Range("A3").Resize(1,NumberOfWaterlines+NumberOf3DCurves+2) c UnderScorerng2.Borders(9).linestyle = -4119 ' Dim Totalrng2 Set Totalrng2 = wb.Activesheet.Range("A1").Resize(TotalPrintRowsWL+3,NumberOfWaterlines+NumberOf3DCurves+2) Q Totalrng2.Borders(7).linestyle = 1 K Totalrng2.Borders(7).Weight = 4 Q Totalrng2.Borders(8).linestyle = 1 K Totalrng2.Borders(8).Weight = 4 Q Totalrng2.Borders(9).linestyle = 1 K Totalrng2.Borders(9).Weight = 4 S Totalrng2.Borders(10).linestyle = 1 M Totalrng2.Borders(10).Weight = 4 S headerrng2.Borders(9).linestyle = 1 M headerrng2.Borders(9).Weight = 4 ] StaColumn3.Borders(10).linestyle = -4119 [ StaColumn4.Borders(7).linestyle = -4119 3  Dim rng2 Set rng2 = wb.Activesheet.Range("A3").Resize(TotalPrintRowsWL+1,NumberOfWaterlines+ NumberOf3DCurves +2) C rng2.value = WaterlinePrint C rng2.NumberFormat = "0.000" u 'auto fits the two title rows of the waterline table % Dim autorng2 Set autorng2 = wb.Activesheet.Range("A2").Resize(2,NumberOfWaterlines+NumberOf3DCurves+2) = autorng2.Columns.AutoFit Endcol = ChrW(NumberOfWaterlines+ NumberOf3DCurves + 1 + 65) Y For i=4 To TotalPrintRowsWL + 3 Step 2 % Dim extrarows2 _ Set extrarows2 = wb.ActiveSheet.Range("A1") ? extrarows2.EntireRow.Insert + Dim Newheaderrng2 Set Newheaderrng2 = wb.Activesheet.Range("A1").Resize(1,NumberOfWaterlines+NumberOf3DCurves+2) / Newheaderrng2.merge Y Newheaderrng2.value = "TABLE OF OFFSETS" [ Newheaderrng2.HorizontalAlignment = -4108 E Newheaderrng2.Font.Bold = True U Newheaderrng2.Borders(9).linestyle = 1 O Newheaderrng2.Borders(9).Weight = 4 + Dim Newborderrng2 Set Newborderrng2 = wb.Activesheet.Range("A1").Resize(6,NumberOfWaterlines+NumberOf3DCurves+2) U Newborderrng2.Borders(7).linestyle = 1 O Newborderrng2.Borders(7).Weight = 4 U Newborderrng2.Borders(8).linestyle = 1 O Newborderrng2.Borders(8).Weight = 4 W Newborderrng2.Borders(10).linestyle = 1 Q Newborderrng2.Borders(10).Weight = 4 'Prints the file name, units, and absolute tolerance for the waterline table 3 Dim PrintfileNamerng3 m Set PrintfileNamerng3 = wb.ActiveSheet.Range("A3") U PrintfileNamerng3.value = "File Name:" M PrintfileNamerng3.Font.Bold = True 3 Dim PrintfileNamerng4 m Set PrintfileNamerng4 = wb.ActiveSheet.Range("D3") g PrintfileNamerng4.value = Rhino.DocumentName () + Dim PrintUnitrng3 e Set PrintUnitrng3 = wb.ActiveSheet.Range("A4") E PrintUnitrng3.value = "Units:" E PrintUnitrng3.Font.Bold = True + Dim PrintUnitrng4 e Set PrintUnitrng4 = wb.ActiveSheet.Range("D4") PrintUnitrng4.value = Rhino.UnitSystemName (True , False , False) 5 Dim PrintTolerancerng3 o Set PrintTolerancerng3 = wb.ActiveSheet.Range("A5") i PrintTolerancerng3.value = "Absolute Tolerance:" O PrintTolerancerng3.Font.Bold = True 5 Dim PrintTolerancerng4 o Set PrintTolerancerng4 = wb.ActiveSheet.Range("D5") { PrintTolerancerng4.value = Rhino.UnitAbsoluteTolerance () e PrintTolerancerng4.HorizontalAlignment = -4131 A 'Delete any empty worksheets  Dim sh A For Each sh In wb.Worksheets o If App.WorksheetFunction.CountA(sh.Cells) = 0 Then ? App.DisplayAlerts = False  sh.Delete = App.DisplayAlerts = True G 'Give the user control of Excel 7 app.UserControl = True ' successful=True - successful = False Rhino.MessageBox "No section curves found", 48, "Offset Table Error" End Sub )3nn{ONhunz\V4?_ :        0 (U"|uU0 ! ) 9= E  MyTemplate8.0.0.0    My.Computer My.UserMy.ApplicationMy.WebServicesa  a4System.Web.Services.Protocols.SoapHttpClientProtocolCreate__Instance__Dispose__Instance__   !!)} 9 TWrapNonExceptionThrows33 3_CorDllMainmscoree.dll% @0HX@ll4VS_VERSION_INFO?DVarFileInfo$TranslationStringFileInfo000004b0,FileDescription 0FileVersion0.0.0.0LInternalNameOrca3DOffsetTable.dll(LegalCopyright TOriginalFilenameOrca3DOffsetTable.dll4ProductVersion0.0.0.08Assembly Version0.0.0.00 3