MZ@ !L!This program cannot be run in DOS mode. $PELI! p Ό @ @xS  H.textl p `.rsrc@@.reloc @BHt/]( *( *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*0rmp*0( *(! *0rwp*0rp*0rp*0rp*0r p*0r?p*0rcp*0rep**>~,**(" *0rp( *0rp*0> ( rp r%p(# rIp(# rp(# rp(# rp(# rp(# rp(# r{p(# r4p(# rp(# rp(# rp(# rp(# rp(# r- p(# r p(# r p(# r p(# r p(# r, p(# rd p(# r p(# r p(# r p(# r> p(# r/p(# rp(# r2p(# rp(# rp(# rBp(# rp(# r)p(# rp(# rp(# rp(# rp(# rLp(# rp(# rp(# r_p(# rp(# rp(# rp(# rop(# rp(# rp(# rp(# rp(# r=p(# rOp(# rp(# rp(# rp(# rp(# r!p(# rAp(# r<p(# rp(# rp(# r6p(# rp(# rOp(# rPp(# rhp(# rp(# rwp(# rp(# rJp(# r~p(# rp(# rp(# r p(# r!p(# r"p(# r"p(# rM#p(# rg#p(# r#p(# r$p(# r_$p(# r$p(# r &p(# r2&p(# rj&p(# r&p(# rF'p(# rb'p(# r'p(# r(p(# r(p(# rV)p(# rv)p(# r)p(# rp(# r)p(# r)p(# r(*p(# r +p(# rU+p(# rq+p(# r+p(# r+p(# r+p(# rp(# rop(# r,p(# r,p(# r,p(# r--p(# r-p(# r-p(# r-p(# r9.p(# r.p(# r.p(# r%/p(# ru/p(# r/p(# r/p(# r/p(# r0p(# rE0p(# r[0p(# r0p(# r0p(# r1p(# r[1p(# r1p(# r1p(# r2p(# r72p(# rQ2p(# r2p(# r2p(# r2p(# rZ3p(# rp(# rp(# rp(# r3p(# r4p(# r[0p(# r0p(# r0p(# r1p(# r[1p(# r1p(# r1p(# r2p(# r72p(# rQ2p(# r2p(# r2p(# r2p(# rZ3p(# rp(# rp(# rp(# r94p(# ro4p(# r[0p(# r0p(# r0p(# r1p(# r[1p(# r1p(# r1p(# r2p(# r72p(# rQ2p(# r2p(# r2p(# r2p(# rZ3p(# rp(# rp(# rp(# r4p(# r4p(# r5p(# r5p(# r5p(# r6p(# rL6p(# r6p(# r6p(# r7p(# r.7p(# r-p(# r4p(# rh7p(# r7p(# r7p(# r88p(# r~8p(# r8p(# r8p(# r 9p(# rH9p(# rp(# rr9p(# r4p(# r9p(# r9p(# r-p(# r":p(# r-p(# r:p(# rO;p(# r;p(# r-p(# r<p(# r<p(# r-p(# r<p(# rp(# r@=p(# r=p(# r>p(# rp(# rf?p(# r?p(# rp(# rp(# r-p(# r@p(# rAp(# rGBp(# rbCp(# rDp(# r<p(# rFp(# rFp(# rGp(# rp(# r-p(# rwHp(# r-p(# r4p(# rHp(# rQIp(# ryIp(# rIp(# rJp(# rcJp(# rJp(# rKp(# rhKp(# rp(# rp(# r=p(# rKp(# r Lp(# rp(# r>Lp(# rop(# r-p(# rLp(# ($ o% &*BSJB v2.0.50727l#~@#Strings L#USZ#GUIDZp#BlobW 3 $''   J,ZS 0S S6/)BoW  %Z:xSS $S29V:v:)7:7 E7 O ] x% )!1u 1-1:1G!P &X &` a h ( 5 B Fc!F$h!5l4!F=qH!Fxd!d!&!x!&!&!F!Fq"Fq"F)h0"&8"FMqL"FUq`"F]qt"Fcq"Fgq"Ftq"Fzq"Fq"a""&"F#Fq(#F"[[  &q&&&&$&,&4&<&$x,x4x<x&&&ibc$h)o=q&&DLL L&&9&A&)hI&Q&++C1L6&B&)0.;P.3G@+@CCIcciA+{sN++++ + #s@@+``++++++ gkv{${{k{{{{{{{{${<JOTY^  uu  S YYY--mscorlibMicrosoft.VisualBasicMyApplicationMyMyComputerMyProjectMyWebServicesThreadSafeObjectProvider`1MonkeyScriptWrapperPluginPlugInAttributesLibraryLoader_abb0292a_c0e9_4e99_78da_038b34e47e8bThedrawLsystemCommandMicrosoft.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.RhinoMRhinoUtilityPlugInGuidPlugInIDPlugInNamePlugInVersionOnLoadPlugInMRhinoPlugInAttributesAddressCountryEmailFaxOrganizationPhoneUpdateURLWebsitem_LoadedLoadLibrariesMRhinoScriptCommandCommandUUIDEnglishCommandNameIRhinoCommandresultIRhinoCommandContextRunCommandcontextSystem.ComponentModelEditorBrowsableAttributeEditorBrowsableStateSystem.CodeDom.CompilerGeneratedCodeAttributeSystem.DiagnosticsDebuggerHiddenAttributeMicrosoft.VisualBasic.CompilerServicesStandardModuleAttributeHideModuleNameAttributeSystem.ComponentModel.DesignHelpKeywordAttributeSystem.Runtime.CompilerServicesRuntimeHelpersGetObjectValueRuntimeTypeHandleGetTypeFromHandleActivatorCreateInstanceMyGroupCollectionAttributeget_Valueset_ValueSystem.Runtime.InteropServicesComVisibleAttributeMRhinoPlugInStringConcatRhUtilMRhinoAppRhinoAppRunScriptCompilationRelaxationsAttributeRuntimeCompatibilityAttributeLsystemDiagramLsystemDiagram.dllM{abb0292a-c0e9-4e99-78da-038b34e47e8b}LsystemDiagram 1.01'<Developer address>'<Developer country>%<Developer E-Mail><Developer fax>1<Developer organization>#<Developer phone>5blog.algorithmicdesign.netM{566fe609-b75b-477c-b0b5-ffcdb12592e2}drawLsystem#! -_RunScript ( #Option Explicit E'Script written by Ezio Blasetti 'Some custom functions belong to earlier script by Dave Pigram m'Script version Sunday, February 08, 2009 8:36:45 PM Call Setup() Sub Setup() Dim intNumberRules : intNumberRules = Rhino.GetInteger("Input the number of rules", 4, 2) Dim intGenerations : intGenerations = Rhino.GetInteger("how many generations", 10, 3) Dim dblDistance : dblDistance = Rhino.GetReal("total width of the diagram",10)  Dim strGeneration : strGeneration = Rhino.StringBox("use CAPS for letters and space for delimiters","A B", "Initial Generation Input") Dim arrRuleStrings : arrRuleStrings = getRules(intNumberRules)  Dim arrStartStrings : arrStartStrings = arrRuleStrings(0) Dim arrSubstituteStrings : arrSubstituteStrings = arrRuleStrings(1) Dim arrTokens : arrTokens = Rhino.Strtok(strGeneration) ] Dim minX : minX = 0 } Dim maxX : maxX = dblDistance Dim dblSpacing : dblSpacing = (maxX-minX)/(Ubound(arrTokens)+1)  Dim arrCharacters : arrCharacters = CullDuplicateStrFrom3Arrays(arrTokens, arrStartStrings, arrSubstituteStrings) 'Dim arrCharacters : arrCharacters = array("A","B","C","D") 7 Call Rhino.AddLayer("0") G Call Rhino.EnableRedraw(vbFalse)  Dim i, j ? For i=0 To Ubound(arrTokens) 9 maxX = minX + dblSpacing Dim strPlane : strPlane = Rhino.AddSrfPt (array(array(minX,0,0),array(maxX,0,0),array(maxX,-1,0),array(minX,-1,0)))  'Dim strPlane : strPlane = Rhino.AddSrfPt (array(array(i,0,0),array(i+1,0,0),array(i+1,-1,0),array(i,-1,0)))  minX = maxX q Call Rhino.ObjectName(strPlane, Ucase(arrTokens(i))) S Call Rhino.ObjectLayer(strPlane, "0") I For j=0 To Ubound(arrCharacters) U If arrTokens(i)=arrCharacters(j) Then Dim intColorValue : intColorValue = j*(255/Ubound(arrCharacters)) Call Rhino.ObjectColor(strPlane, RGB(intColorValue+30,0,intColorValue+30))  End If  Next  Next E Call Rhino.EnableRedraw(vbTrue) 9 For i=1 To intGenerations I Call Rhino.EnableRedraw(vbFalse) Call Main(i, arrStartStrings, arrSubstituteStrings, arrCharacters) G Call Rhino.EnableRedraw(vbTrue) i Call cleanUpLayers(arrCharacters, intGenerations) ] Rhino.Print "thanks for playing with me..." End Sub Sub Main(intGen, arrStartStrings, arrSubstituteStrings, arrCharacters) Dim arrParents : arrParents = Rhino.ObjectsByLayer(CStr(intGen-1)) [ arrParents = reverseArrayOrder(arrParents) = Call Rhino.AddLayer(intGen)  Dim i A For i=0 To Ubound(arrParents) g Dim strParent : strParent = arrParents(i) Dim strParentName : strParentName = Rhino.ObjectName (strParent) Dim arrParentPts : arrParentPts = Rhino.SurfacePoints(strParent)  Dim k : k=0 Do While k <= Ubound(arrStartStrings) 'Ubound(arrStartStrings) is equal to intNumberRules -1 ie loop through each rule  Dim arrRuleTokens : arrRuleTokens = Rhino.Strtok(arrStartStrings(k)) 'skip the check if there are not enough letters left in the generation to match the current start string  If Not i + Ubound(arrRuleTokens) > Ubound(arrParents) Then 'reset the variable that holds the string to be compared to the current startString c Dim strToCompare : strToCompare = Null 'create a single string that is the same length as the current rule start string with underscores seperating each letter.  Dim j S For j = 0 To Ubound(arrRuleTokens) strToCompare = addString2String(strToCompare, Rhino.ObjectName(arrParents(i+j))," ") I Next ' end ruleTokens loop  'compare to the rule and if it matches, make the substitution 3 'print "k is: " & k o If arrStartStrings(k) = strToCompare Then  Dim arrTokens : arrTokens = Rhino.Strtok(arrSubstituteStrings(k)) Dim arrParentUboundPt : arrParentUboundPt = Rhino.SurfacePoints(arrParents(i+Ubound(arrRuleTokens))) Dim minX : minX = arrParentPts(0)(0) Dim maxX : maxX = arrParentUboundPt(2)(0) Dim dblSpacing : dblSpacing = (maxX-minX)/(Ubound(arrTokens)+1)  Dim e G For e=0 To Ubound(arrTokens) m 'print "minX is:" & minX & " maxX is :" & maxX A maxX = minX + dblSpacing w 'add the substitution string To the Next generation 1 Dim strPlane : strPlane = Rhino.AddSrfPt (array(array(minX,-intGen-1,0),array(maxX,-intGen-1,0),array(maxX,-intGen,0),array(minX,-intGen,0))) ' minX = maxX 7 'print arrTokens(e) y Call Rhino.ObjectName(strPlane, Ucase(arrTokens(e))) a Call Rhino.ObjectLayer(strPlane, intGen)  Dim l Q For l=0 To Ubound(arrCharacters) ] If arrTokens(e)=arrCharacters(l) Then Dim intColorValue : intColorValue = l*(255/Ubound(arrCharacters)) Call Rhino.ObjectColor(strPlane, RGB(intColorValue+30,0,intColorValue+30))  End If  Next  Next 5 'finish this k-loop I k = Ubound(arrStartStrings) 'skip ahead to the next unused letter in this generation, before checking against the first start string I i = i + Ubound(arrRuleTokens)  End If  End If - 'progress counter  k = k + 1 A Loop 'arrStartStrings loop qFunction CullDuplicateStrFrom3Arrays(arr0, arr1, arr2) K CullDuplicateStrFrom3Arrays = Null U If Not IsArray(arr0) Then Exit Function U If Not IsArray(arr1) Then Exit Function U If Not IsArray(arr2) Then Exit Function  W 'arr0 = Rhino.CullDuplicateStrings(arr0) W 'arr1 = Rhino.CullDuplicateStrings(arr1) W 'arr2 = Rhino.CullDuplicateStrings(arr2) ; ReDim arrDifferentChars(0) O Dim arrTokens, i, j, k, bln, blnTemp  Dim str 5 For i=0 To Ubound(arr0) # str = arr0(i)  If i=0 Then ? arrDifferentChars(0) = str  End If C arrTokens = Rhino.Strtok(str) A For j=0 To Ubound(arrTokens) % bln = VbFalse S For k=0 To Ubound(arrDifferentChars) c If arrTokens(j) = arrDifferentChars(k) Then / blnTemp = vbTrue  Else 1 blnTemp = vbFalse  End If 5 bln = bln Or blnTemp  Next 5 If bln = vbFalse Then ReDim Preserve arrDifferentChars(Ubound(arrDifferentChars)+1) arrDifferentChars(Ubound(arrDifferentChars)) = arrTokens(j) 5 For i=0 To Ubound(arr1) # str = arr1(i) 5 For i=0 To Ubound(arr2) # str = arr2(i) e CullDuplicateStrFrom3Arrays = arrDifferentChars End Function Function addString2String(strOriginalString, strStringToAdd, strSpacer) 7 addString2String = Null  Dim strNew I If IsNull(strOriginalString) Then = strNew = strStringToAdd  Else } strNew = strOriginalString & strSpacer & strStringToAdd  End If 9 addString2String = strNew CFunction reverseArrayOrder(arr) 7 reverseArrayOrder = Null S If Not IsArray(arr) Then Exit Function E Dim arrReturn : arrReturn = arr  Dim i E Dim count : count = Ubound(arr) 3 For i=0 To Ubound(arr) ; arrReturn(i) = arr(count) ) count= count - 1 A reverseArrayOrder = arrReturn GFunction getRules(intNumberRules) % getRules = Null Dim i, arrRulePrompts(), arrDefaultStarts(), arrDefaultSubs(), arrStartStrings, arrSubstituteStrings Y ReDim arrRulePrompts (intNumberRules - 1) ] ReDim arrDefaultStarts (intNumberRules - 1) Y ReDim arrDefaultSubs (intNumberRules - 1)  'create arrays of strings to populate the Property List Boxes E For i = 0 To intNumberRules - 1 o arrRulePrompts (i) = "Rule " & i & " Start String:" ] 'get the previously used rules from a file  arrDefaultStarts(i) = Rhino.GetSettings(Rhino.InstallFolder & "Lsystem.ini", "L-System", "DefaultStarts_" & i)  arrDefaultSubs (i) = Rhino.GetSettings(Rhino.InstallFolder & "Lsystem.ini", "L-System", "DefaultSubs_" & i)  If IsNull(arrDefaultStarts (i)) Then arrDefaultStarts (i) = "X_X..." If IsNull(arrDefaultSubs (i)) Then arrDefaultSubs (i) = "X_X..." U 'prompt for the user to input the rules in two phases: first the strings that will be replaced - this will be in heirarchial order ie first rule will be enacted first k 'longer strings (clauses) should be entered first.  'In the second phase the leters that will be substituted For the starting strings are entered underscores ("_") must seperate Each letter I arrStartStrings = Rhino.PropertyListBox (arrRulePrompts, arrDefaultStarts, "use CAPS for letters and space for delimiters" , "L-System Rules: Start Strings") S arrSubstituteStrings = Rhino.PropertyListBox (arrStartStrings, arrDefaultSubs, "use CAPS for letters and space for delimiters" , "L-System Rules: Substitute Strings")  'write these rules to a file so that you don't have to re-enter them next time  Rhino.SaveSettings Rhino.InstallFolder & "Lsystem.ini", "L-System", "DefaultStarts_" & i, arrStartStrings(i)  Rhino.SaveSettings Rhino.InstallFolder & "Lsystem.ini", "L-System", "DefaultSubs_" & i, arrSubstituteStrings(i) s getRules = array(arrStartStrings,arrSubstituteStrings) eSub cleanUpLayers(arrCharacters, intGenerations) ' Dim strCharacter I Call Rhino.EnableRedraw (vbFalse) S For Each strCharacter In arrCharacters K Call Rhino.AddLayer(strCharacter) Dim arrObjects : arrObjects = Rhino.ObjectsByName(Ucase(strCharacter)) # Dim strObject I For Each strObject In arrObjects i Call Rhino.ObjectLayer(strObject, strCharacter) 9 For i=0 To intGenerations 1 Rhino.DeleteLayer(i) G Call Rhino.EnableRedraw (vbTrue) ) % #ԫBɚjz\V4?_ :        0 (U"|uU0 ! 15 =  MyTemplate8.0.0.0   My.Application My.Computer My.UserMy.WebServicesY  a4System.Web.Services.Protocols.SoapHttpClientProtocolCreate__Instance__Dispose__Instance__   !!u 1 TWrapNonExceptionThrows _CorDllMainmscoree.dll% @0HXdd4VS_VERSION_INFO?DVarFileInfo$TranslationStringFileInfo000004b0,FileDescription 0FileVersion0.0.0.0HInternalNameLsystemDiagram.dll(LegalCopyright POriginalFilenameLsystemDiagram.dll4ProductVersion0.0.0.08Assembly Version0.0.0.0 <