From 14b3c1a268eeced1b069d4495436768133de60ac Mon Sep 17 00:00:00 2001 From: Andrea Settimi Date: Wed, 6 Nov 2024 18:13:35 +0100 Subject: [PATCH] Patching list-2-tree automatic convertion (#46) * WIP: working mix nested list bug and deep nested lists * CAP-WIP: solved problem for listing to tree output --- GH/CsGH/CsGH.csproj | 15 ++ GH/CsGH/CsGHComponent.cs | 64 +++++++ GH/CsGH/CsGHInfo.cs | 26 +++ GH/CsGH/Properties/launchSettings.json | 9 + GH/CsGH/bin/Debug/net48/CsGH.gha | Bin 0 -> 5120 bytes GH/CsGH/bin/Debug/net48/CsGH.pdb | Bin 0 -> 2476 bytes GH/CsGH/obj/CsGH.csproj.nuget.dgspec.json | 59 ++++++ GH/CsGH/obj/CsGH.csproj.nuget.g.props | 19 ++ GH/CsGH/obj/CsGH.csproj.nuget.g.targets | 10 + ...amework,Version=v4.8.AssemblyAttributes.cs | 4 + GH/CsGH/obj/Debug/net48/CsGH.AssemblyInfo.cs | 23 +++ .../Debug/net48/CsGH.AssemblyInfoInputs.cache | 1 + ....GeneratedMSBuildEditorConfig.editorconfig | 3 + GH/CsGH/obj/Debug/net48/CsGH.assets.cache | Bin 0 -> 1155 bytes .../net48/CsGH.csproj.AssemblyReference.cache | Bin 0 -> 11646 bytes .../net48/CsGH.csproj.CoreCompileInputs.cache | 1 + .../net48/CsGH.csproj.FileListAbsolute.txt | 9 + GH/CsGH/obj/Debug/net48/CsGH.gha | Bin 0 -> 5120 bytes GH/CsGH/obj/Debug/net48/CsGH.pdb | Bin 0 -> 2476 bytes GH/CsGH/obj/project.assets.json | 138 ++++++++++++++ GH/CsGH/obj/project.nuget.cache | 11 ++ GH/PyGH/components/scriptsynccpy/code.py | 179 ++++++++++++++---- 22 files changed, 533 insertions(+), 38 deletions(-) create mode 100644 GH/CsGH/CsGH.csproj create mode 100644 GH/CsGH/CsGHComponent.cs create mode 100644 GH/CsGH/CsGHInfo.cs create mode 100644 GH/CsGH/Properties/launchSettings.json create mode 100644 GH/CsGH/bin/Debug/net48/CsGH.gha create mode 100644 GH/CsGH/bin/Debug/net48/CsGH.pdb create mode 100644 GH/CsGH/obj/CsGH.csproj.nuget.dgspec.json create mode 100644 GH/CsGH/obj/CsGH.csproj.nuget.g.props create mode 100644 GH/CsGH/obj/CsGH.csproj.nuget.g.targets create mode 100644 GH/CsGH/obj/Debug/net48/.NETFramework,Version=v4.8.AssemblyAttributes.cs create mode 100644 GH/CsGH/obj/Debug/net48/CsGH.AssemblyInfo.cs create mode 100644 GH/CsGH/obj/Debug/net48/CsGH.AssemblyInfoInputs.cache create mode 100644 GH/CsGH/obj/Debug/net48/CsGH.GeneratedMSBuildEditorConfig.editorconfig create mode 100644 GH/CsGH/obj/Debug/net48/CsGH.assets.cache create mode 100644 GH/CsGH/obj/Debug/net48/CsGH.csproj.AssemblyReference.cache create mode 100644 GH/CsGH/obj/Debug/net48/CsGH.csproj.CoreCompileInputs.cache create mode 100644 GH/CsGH/obj/Debug/net48/CsGH.csproj.FileListAbsolute.txt create mode 100644 GH/CsGH/obj/Debug/net48/CsGH.gha create mode 100644 GH/CsGH/obj/Debug/net48/CsGH.pdb create mode 100644 GH/CsGH/obj/project.assets.json create mode 100644 GH/CsGH/obj/project.nuget.cache diff --git a/GH/CsGH/CsGH.csproj b/GH/CsGH/CsGH.csproj new file mode 100644 index 0000000..4c8a7ea --- /dev/null +++ b/GH/CsGH/CsGH.csproj @@ -0,0 +1,15 @@ + + + + net48 + 1.0 + CsGH + Description of CsGH + .gha + + + + + + + \ No newline at end of file diff --git a/GH/CsGH/CsGHComponent.cs b/GH/CsGH/CsGHComponent.cs new file mode 100644 index 0000000..fafaba9 --- /dev/null +++ b/GH/CsGH/CsGHComponent.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; + +using Grasshopper; +using Grasshopper.Kernel; +using Rhino.Geometry; + +namespace CsGH +{ + public class CsGHComponent : GH_Component + { + /// + /// Each implementation of GH_Component must provide a public + /// constructor without any arguments. + /// Category represents the Tab in which the component will appear, + /// Subcategory the panel. If you use non-existing tab or panel names, + /// new tabs/panels will automatically be created. + /// + public CsGHComponent() + : base("CsGH Component", "Nickname", + "Description of component", + "Category", "Subcategory") + { + } + + /// + /// Registers all the input parameters for this component. + /// + protected override void RegisterInputParams(GH_Component.GH_InputParamManager pManager) + { + } + + /// + /// Registers all the output parameters for this component. + /// + protected override void RegisterOutputParams(GH_Component.GH_OutputParamManager pManager) + { + } + + /// + /// This is the method that actually does the work. + /// + /// The DA object can be used to retrieve data from input parameters and + /// to store data in output parameters. + protected override void SolveInstance(IGH_DataAccess DA) + { + } + + /// + /// Provides an Icon for every component that will be visible in the User Interface. + /// Icons need to be 24x24 pixels. + /// You can add image files to your project resources and access them like this: + /// return Resources.IconForThisComponent; + /// + protected override System.Drawing.Bitmap Icon => null; + + /// + /// Each component must have a unique Guid to identify it. + /// It is vital this Guid doesn't change otherwise old ghx files + /// that use the old ID will partially fail during loading. + /// + public override Guid ComponentGuid => new Guid("57815B6C-58D2-42BE-84D7-6EA495D6A5B1"); + } +} \ No newline at end of file diff --git a/GH/CsGH/CsGHInfo.cs b/GH/CsGH/CsGHInfo.cs new file mode 100644 index 0000000..5e45b44 --- /dev/null +++ b/GH/CsGH/CsGHInfo.cs @@ -0,0 +1,26 @@ +using System; +using System.Drawing; +using Grasshopper; +using Grasshopper.Kernel; + +namespace CsGH +{ + public class CsGHInfo : GH_AssemblyInfo + { + public override string Name => "CsGH Info"; + + //Return a 24x24 pixel bitmap to represent this GHA library. + public override Bitmap Icon => null; + + //Return a short string describing the purpose of this GHA library. + public override string Description => ""; + + public override Guid Id => new Guid("8FDABF86-6067-4496-977B-E17C6341F89E"); + + //Return a string identifying you or your company. + public override string AuthorName => ""; + + //Return a string representing your preferred contact details. + public override string AuthorContact => ""; + } +} \ No newline at end of file diff --git a/GH/CsGH/Properties/launchSettings.json b/GH/CsGH/Properties/launchSettings.json new file mode 100644 index 0000000..a4f5b31 --- /dev/null +++ b/GH/CsGH/Properties/launchSettings.json @@ -0,0 +1,9 @@ +{ + "profiles": { + "CsGH": { + "commandName": "Executable", + "executablePath": "C:\\Program Files\\Rhino 7\\System\\Rhino.exe", + "commandLineArgs": "" + } + } +} \ No newline at end of file diff --git a/GH/CsGH/bin/Debug/net48/CsGH.gha b/GH/CsGH/bin/Debug/net48/CsGH.gha new file mode 100644 index 0000000000000000000000000000000000000000..ff3c055b8e625729db7545f28be33722c248f7a1 GIT binary patch literal 5120 zcmeHLU2Ggz6+U;ow$~fmjT5)DMQJBZN*y=Z?$-Z-5U;)dSrY%?-K1%;>dcPE>uG0a zmOHaa429&Sh#%1(Bv6prst6=_K&mAWjfzTxRPolTA{5F)rBXl&w1^id6%T~(+?n;R zoe&U@Rqy(qIe+)eIp^Mc?j6rO@B}pxQ4Iac6`~7xavN3f`rsVIowvWxNk49TW%mVf z^p)L(RomAq(kn@$teb}GdVyZFbXj$E+tsskdA;l{Tgi@&#NNpC`~=Za(L{gTf8V9r z+uou(^lc(V)DBKd$bGdJPaS;}ooKtlwa{;7L~2CmK!DG!iB3Mss{B`fMkKS)J`cNd zjEoYcI1yXh$zmPfE-2pvWnsljv+~2YN#rB^qlW75W_K6^(tK5GqzA zxkKwg4q%AJ@}C+Lk+&TCss3at*_Y}|kFfL2w&h!#J)K1AlXhwA7&}bAgiZ%I{MPW@oHc>1@t)Q}0}5v< z25JUWE6wYy`=y(g;h!L1Q7_XEwGmLKBI=@c7!j^T)FGNce2;`w{I}u=7VB9>{UUxh z&4c<{L>-}HpuQ1Nq2@Ou>TiN&Pes&THSPxyRZ!!ei>N$oL-+jFlL=G+xemW=>H!}*U| zm#R|fU2P<5`KGihY@{yaux&?;Sg;)9jKci7ycW*9L^93bY5^NC+_k!3q3Q;9*;4$# zF4~SAG)VJneqfc8ky0{>1$B-hNmd%CnVgb_@2`55iY1drEa_TKq!CV<>AAHL3)YHb znH-i9HH4{VoO4H0(@V8T6g_4KWuwCEoLi{|^9Ckn#&C_2C7C%_4YqPC8{)cSlr#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{Z%8r zw=n#3$O_&6rg zVh}l%a$CsSiiS#=7Pys?yrSeTPF6yact;yWx=D|sa00_eJt{oxOhn}rD3ld%F19|l zA@+Ez+w^kHvY`MSy!<4u}pxi`7ZHsnVd0q1hnAajs^Tp(#7%3{o6JSsBFBVoQW> z;gGioDN;lZa^_~pZ4OEiQAHGzB5F9InpcEG7WtwgErfzJ&qr%Q;tGzf2{AG)N0Ag( zLqh05T7_*xEZ$gin2#tZ%+qSKBn!wRM!n$(k|AeE;70m(kQUsmlP+~rR?6+rNV6jeT%;Z9HHSnFH3U4~iV|N%d85As-_C$%e#N4? zKs5%G8~@rYO?81Lf1twCP!YfZ`>22;g+Zk9zyee`-u0t^O1gQjf+=Z1C-IQUUrWIC0~z-G$}7 z=Bd3~iayC6PAAhV;d`lNG+;8Eva2nd#yzHd%hugxBC8xx7I*YbNMp67!21X4&pC*sv-Bt4T8lE!2; zCyN}Pop{3hoFs6n934-zR}<|4qFo@`qeT109QemT<&QNX!Wf0muP*-ogP3BtHoiG& yOeV(o`>J<2v9rvXm2&4Z;}y;)Dqu>+xM^`gR@~`wX2o?AOxWqJyCv=l&Hn)nE3;<+ literal 0 HcmV?d00001 diff --git a/GH/CsGH/obj/CsGH.csproj.nuget.dgspec.json b/GH/CsGH/obj/CsGH.csproj.nuget.dgspec.json new file mode 100644 index 0000000..74fb8f1 --- /dev/null +++ b/GH/CsGH/obj/CsGH.csproj.nuget.dgspec.json @@ -0,0 +1,59 @@ +{ + "format": 1, + "restore": { + "F:\\script-sync\\GH\\CsGH\\CsGH.csproj": {} + }, + "projects": { + "F:\\script-sync\\GH\\CsGH\\CsGH.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "F:\\script-sync\\GH\\CsGH\\CsGH.csproj", + "projectName": "CsGH", + "projectPath": "F:\\script-sync\\GH\\CsGH\\CsGH.csproj", + "packagesPath": "C:\\Users\\andre\\.nuget\\packages\\", + "outputPath": "F:\\script-sync\\GH\\CsGH\\obj\\", + "projectStyle": "PackageReference", + "crossTargeting": true, + "fallbackFolders": [ + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" + ], + "configFilePaths": [ + "C:\\Users\\andre\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "net48" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net48": { + "targetAlias": "net48", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "net48": { + "targetAlias": "net48", + "dependencies": { + "Grasshopper": { + "include": "Compile, Build", + "target": "Package", + "version": "[8.0.23164.14305-wip, )" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\5.0.408\\RuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/GH/CsGH/obj/CsGH.csproj.nuget.g.props b/GH/CsGH/obj/CsGH.csproj.nuget.g.props new file mode 100644 index 0000000..abd2a55 --- /dev/null +++ b/GH/CsGH/obj/CsGH.csproj.nuget.g.props @@ -0,0 +1,19 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + $(UserProfile)\.nuget\packages\ + C:\Users\andre\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages + PackageReference + 5.11.1 + + + + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + \ No newline at end of file diff --git a/GH/CsGH/obj/CsGH.csproj.nuget.g.targets b/GH/CsGH/obj/CsGH.csproj.nuget.g.targets new file mode 100644 index 0000000..032b0f2 --- /dev/null +++ b/GH/CsGH/obj/CsGH.csproj.nuget.g.targets @@ -0,0 +1,10 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + + + + + \ No newline at end of file diff --git a/GH/CsGH/obj/Debug/net48/.NETFramework,Version=v4.8.AssemblyAttributes.cs b/GH/CsGH/obj/Debug/net48/.NETFramework,Version=v4.8.AssemblyAttributes.cs new file mode 100644 index 0000000..15efebf --- /dev/null +++ b/GH/CsGH/obj/Debug/net48/.NETFramework,Version=v4.8.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] diff --git a/GH/CsGH/obj/Debug/net48/CsGH.AssemblyInfo.cs b/GH/CsGH/obj/Debug/net48/CsGH.AssemblyInfo.cs new file mode 100644 index 0000000..996d6e7 --- /dev/null +++ b/GH/CsGH/obj/Debug/net48/CsGH.AssemblyInfo.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("CsGH")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyDescriptionAttribute("Description of CsGH")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0")] +[assembly: System.Reflection.AssemblyProductAttribute("CsGH")] +[assembly: System.Reflection.AssemblyTitleAttribute("CsGH")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/GH/CsGH/obj/Debug/net48/CsGH.AssemblyInfoInputs.cache b/GH/CsGH/obj/Debug/net48/CsGH.AssemblyInfoInputs.cache new file mode 100644 index 0000000..3a1da4d --- /dev/null +++ b/GH/CsGH/obj/Debug/net48/CsGH.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +8cbbdd594077555e06bb3b9285b5118f2966b3f2 diff --git a/GH/CsGH/obj/Debug/net48/CsGH.GeneratedMSBuildEditorConfig.editorconfig b/GH/CsGH/obj/Debug/net48/CsGH.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..412059e --- /dev/null +++ b/GH/CsGH/obj/Debug/net48/CsGH.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,3 @@ +is_global = true +build_property.RootNamespace = CsGH +build_property.ProjectDir = F:\script-sync\GH\CsGH\ diff --git a/GH/CsGH/obj/Debug/net48/CsGH.assets.cache b/GH/CsGH/obj/Debug/net48/CsGH.assets.cache new file mode 100644 index 0000000000000000000000000000000000000000..05102e87f80e6bb989a4070d4bbdd882d9a75141 GIT binary patch literal 1155 zcmWIWc6a1rU|`_aOm#5Q-?a9xox{Y)DbIZld=onp!5a8@hn`7<_vOdkbC`jOpnwfX z2RU2Cgche36~`pzr4*&c=;f8Bri#Sm+t(85tXz zndljs7#o=CmS+~klBtAI7Hadd?9-pP$Kugg9D9pLt5orJ<&y8drh!0XDPat?e>fC{9 z0*dm1Nj+D=Ei)&zSV7guqQb&V)yOi&H#4~?zc@dwL?JA*xHK_GA-JS8B{M%JI3uwr zH6_Nc)IGH%0Ge4qW?=(7KtVoam7XccP8UX&3Ik@v%=|oIEP0JLAh9IFGY@K;Ffixo sgL9rfJm*Owi6Mdp6tu`eBZ5$cNY8>uf{;Wfh7dtc8Ax^@1vkhJ08pMk*Z=?k literal 0 HcmV?d00001 diff --git a/GH/CsGH/obj/Debug/net48/CsGH.csproj.AssemblyReference.cache b/GH/CsGH/obj/Debug/net48/CsGH.csproj.AssemblyReference.cache new file mode 100644 index 0000000000000000000000000000000000000000..d0d7c6510a174a97f3e9adae31fe9efad38562cc GIT binary patch literal 11646 zcmds73sBT%9!~@Tp^6q2QMwP`tCPtyO!rT8m1@dQMxbBi#38lYKyJ+}UKV(=dc& z68`!9AK&l)ND4+56&rDUFot1xnQ^$OkYg)3(i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PXA&+?K{v@1pb38mLOsR6mp$i%Asr~8 zk*(xHBOZCg=@Y2GDDJAOTYFKcU6{JZXj5x1DMl6TBdh7D7T$;y82aPg|4%DG^We&K zMQ1XR;X`zyB0%ft9O5iXtu~f{)Lj4zYnsSm7}mk!-c{G#iy`DO_c=I@tA<>OW+5k6 z1TJoza%PwmcaJU?em22ZEbH%zK(D7yiagoN5sBJOpET`X6d47@A=*3{#X;NMi4w=P zEaA28gXOBy>r$wD<)Yo-Pp@7ov=)@}thojV349gF*__1;qQi@AqEp44l4nbw-LpI* zcRPCfCnaR@$Rh>%K4N?PQcYZtjyB!JNok8CT_qc;!C3Inu|DluSQf465*IuctN?B0}rcSQ_oaU5Xg!`zusF9c1y9TxsT7UH;`PAb@qAQ_4>I)!R2PCdQaC>v3 z4#lbi6q!V&PeG(%x;hq%epno%WpxOQ4iFwOWK{>FN0_)zP@RKWbtsiO*u@R{AS zRO^5uk2I4O_yvpGsIMCkwPA}775RkUH@D22x-s=1??#S@z`hvK@%Mf0nV8@|Abs1_ zmJ5r^{LhBIFsJ0rhL?B5-Fn#X?7`h5w)N@Qc6f6vUA-zJc;W|s-}fI^!yJm8@xmL1 zv4fd!=bUcXLXO1VyARGswO(oY@~%1YRO3@QbtRjAaeL_LxbWi_!me)3Nf{p9^TLsH zzcI9k-G%$O5~T_^V#V+!xQFNpVs`=g>Nxa!MkKX~}qwk;35@xXpU*36s z_S>P&uVy_RwfspVh={QsU6Wcc^V}NIL++Ux>4o7{I(S9$hO0vDW_|QzkLa-L0K=8a ll*&YPOger{C|85(AoSoW$v^HDq&g5isN3ZsN7bo{;(xL{!XW?v literal 0 HcmV?d00001 diff --git a/GH/CsGH/obj/Debug/net48/CsGH.csproj.CoreCompileInputs.cache b/GH/CsGH/obj/Debug/net48/CsGH.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..fd23335 --- /dev/null +++ b/GH/CsGH/obj/Debug/net48/CsGH.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +29b94e183ca448bfcd87af0796c4391fd9685fb0 diff --git a/GH/CsGH/obj/Debug/net48/CsGH.csproj.FileListAbsolute.txt b/GH/CsGH/obj/Debug/net48/CsGH.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..29be766 --- /dev/null +++ b/GH/CsGH/obj/Debug/net48/CsGH.csproj.FileListAbsolute.txt @@ -0,0 +1,9 @@ +F:\script-sync\GH\CsGH\bin\Debug\net48\CsGH.gha +F:\script-sync\GH\CsGH\bin\Debug\net48\CsGH.pdb +F:\script-sync\GH\CsGH\obj\Debug\net48\CsGH.csproj.AssemblyReference.cache +F:\script-sync\GH\CsGH\obj\Debug\net48\CsGH.GeneratedMSBuildEditorConfig.editorconfig +F:\script-sync\GH\CsGH\obj\Debug\net48\CsGH.AssemblyInfoInputs.cache +F:\script-sync\GH\CsGH\obj\Debug\net48\CsGH.AssemblyInfo.cs +F:\script-sync\GH\CsGH\obj\Debug\net48\CsGH.csproj.CoreCompileInputs.cache +F:\script-sync\GH\CsGH\obj\Debug\net48\CsGH.gha +F:\script-sync\GH\CsGH\obj\Debug\net48\CsGH.pdb diff --git a/GH/CsGH/obj/Debug/net48/CsGH.gha b/GH/CsGH/obj/Debug/net48/CsGH.gha new file mode 100644 index 0000000000000000000000000000000000000000..ff3c055b8e625729db7545f28be33722c248f7a1 GIT binary patch literal 5120 zcmeHLU2Ggz6+U;ow$~fmjT5)DMQJBZN*y=Z?$-Z-5U;)dSrY%?-K1%;>dcPE>uG0a zmOHaa429&Sh#%1(Bv6prst6=_K&mAWjfzTxRPolTA{5F)rBXl&w1^id6%T~(+?n;R zoe&U@Rqy(qIe+)eIp^Mc?j6rO@B}pxQ4Iac6`~7xavN3f`rsVIowvWxNk49TW%mVf z^p)L(RomAq(kn@$teb}GdVyZFbXj$E+tsskdA;l{Tgi@&#NNpC`~=Za(L{gTf8V9r z+uou(^lc(V)DBKd$bGdJPaS;}ooKtlwa{;7L~2CmK!DG!iB3Mss{B`fMkKS)J`cNd zjEoYcI1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o?AOxWqJyCv=l&Hn)nE3;<+ literal 0 HcmV?d00001 diff --git a/GH/CsGH/obj/project.assets.json b/GH/CsGH/obj/project.assets.json new file mode 100644 index 0000000..1ef5ca7 --- /dev/null +++ b/GH/CsGH/obj/project.assets.json @@ -0,0 +1,138 @@ +{ + "version": 3, + "targets": { + ".NETFramework,Version=v4.8": { + "Grasshopper/8.0.23164.14305-wip": { + "type": "package", + "dependencies": { + "RhinoCommon": "[8.0.23164.14305-wip]" + }, + "compile": { + "lib/net48/GH_IO.dll": {}, + "lib/net48/Grasshopper.dll": {} + }, + "runtime": { + "lib/net48/_._": {} + }, + "build": { + "build/net48/Grasshopper.targets": {} + } + }, + "RhinoCommon/8.0.23164.14305-wip": { + "type": "package", + "compile": { + "lib/net48/Ed.Eto.dll": {}, + "lib/net48/Eto.dll": {}, + "lib/net48/Rhino.UI.dll": {}, + "lib/net48/RhinoCommon.dll": {} + }, + "runtime": { + "lib/net48/_._": {} + }, + "build": { + "build/net48/RhinoCommon.targets": {} + } + } + } + }, + "libraries": { + "Grasshopper/8.0.23164.14305-wip": { + "sha512": "hzHby/AFHT2jnlsA+gKr7exeFuy/xS8oRU1c8zY4GxmYXRGcIqyOAmeVm2e3pvqkcerCp7KYGMHfw4ukpuOaOA==", + "type": "package", + "path": "grasshopper/8.0.23164.14305-wip", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "build/net48/Grasshopper.targets", + "grasshopper.8.0.23164.14305-wip.nupkg.sha512", + "grasshopper.nuspec", + "grasshopper.png", + "lib/net48/GH_IO.dll", + "lib/net48/GH_IO.xml", + "lib/net48/Grasshopper.dll", + "lib/net48/Grasshopper.xml" + ] + }, + "RhinoCommon/8.0.23164.14305-wip": { + "sha512": "kTIWpk+jOG6TmNIn/usy3cX9hyAOT3DITL8CFe6QgpCU7H19c0S3Lm/jAHh0xUJb+WdigsgBgQUeloBwHNc+/g==", + "type": "package", + "path": "rhinocommon/8.0.23164.14305-wip", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Eto-LICENSE.txt", + "build/net48/RhinoCommon.targets", + "lib/net48/Ed.Eto.dll", + "lib/net48/Ed.Eto.xml", + "lib/net48/Eto.dll", + "lib/net48/Eto.xml", + "lib/net48/Rhino.UI.dll", + "lib/net48/RhinoCommon.dll", + "lib/net48/RhinoCommon.xml", + "rhinocommon.8.0.23164.14305-wip.nupkg.sha512", + "rhinocommon.nuspec", + "rhinocommon.png" + ] + } + }, + "projectFileDependencyGroups": { + ".NETFramework,Version=v4.8": [ + "Grasshopper >= 8.0.23164.14305-wip" + ] + }, + "packageFolders": { + "C:\\Users\\andre\\.nuget\\packages\\": {}, + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "F:\\script-sync\\GH\\CsGH\\CsGH.csproj", + "projectName": "CsGH", + "projectPath": "F:\\script-sync\\GH\\CsGH\\CsGH.csproj", + "packagesPath": "C:\\Users\\andre\\.nuget\\packages\\", + "outputPath": "F:\\script-sync\\GH\\CsGH\\obj\\", + "projectStyle": "PackageReference", + "crossTargeting": true, + "fallbackFolders": [ + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" + ], + "configFilePaths": [ + "C:\\Users\\andre\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "net48" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net48": { + "targetAlias": "net48", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "net48": { + "targetAlias": "net48", + "dependencies": { + "Grasshopper": { + "include": "Compile, Build", + "target": "Package", + "version": "[8.0.23164.14305-wip, )" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\5.0.408\\RuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/GH/CsGH/obj/project.nuget.cache b/GH/CsGH/obj/project.nuget.cache new file mode 100644 index 0000000..95c75a2 --- /dev/null +++ b/GH/CsGH/obj/project.nuget.cache @@ -0,0 +1,11 @@ +{ + "version": 2, + "dgSpecHash": "YysQEqrSBDoSgLrjrvnusf6yyCS6W8Dl1PqWizXcJDL678ay7hpOzvKmKZFcviv2GM4Yj3sZx9PDJZjV0Ax0pg==", + "success": true, + "projectFilePath": "F:\\script-sync\\GH\\CsGH\\CsGH.csproj", + "expectedPackageFiles": [ + "C:\\Users\\andre\\.nuget\\packages\\grasshopper\\8.0.23164.14305-wip\\grasshopper.8.0.23164.14305-wip.nupkg.sha512", + "C:\\Users\\andre\\.nuget\\packages\\rhinocommon\\8.0.23164.14305-wip\\rhinocommon.8.0.23164.14305-wip.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/GH/PyGH/components/scriptsynccpy/code.py b/GH/PyGH/components/scriptsynccpy/code.py index f88f216..f05cfa3 100644 --- a/GH/PyGH/components/scriptsynccpy/code.py +++ b/GH/PyGH/components/scriptsynccpy/code.py @@ -1,10 +1,5 @@ import System import System.Drawing -import Rhino -import rhinoscriptsyntax as rs -import Grasshopper -import Grasshopper as gh -from Grasshopper.Kernel import GH_RuntimeMessageLevel as RML import sys import os import time @@ -25,6 +20,14 @@ import traceback +import Rhino +import rhinoscriptsyntax as rs +import Grasshopper +import Grasshopper as gh +from Grasshopper.Kernel import GH_RuntimeMessageLevel as RML +import ghpythonlib.treehelpers as th + + def add_button(self, nickname: str, indx: int, @@ -401,7 +404,6 @@ def safe_exec(self, path, globals, locals, package_2_reload): return locals except Exception as e: - # sys.stdout = sys.__stdout__ # Get the traceback tb = traceback.format_exc() @@ -478,6 +480,18 @@ def AfterRunScript(self): its calculation. It is used to load the GHComponent outputs with the values created in the script. """ + def _is_first_lvl_nested_iterable(lst : typing.List) -> bool: + """ + Detect if the first level of a list is nested. + e.g. + [1, 2, 3, 4, [5,6]] --> return value: False + [[1, 2], [3, 4]] --> return value: True + + :param lst: The list to check + :return: True if the first level is nested, False otherwise + """ + return all(isinstance(item, list) for item in lst) + def _nesting_level(container: typing.Union[typing.List, typing.Tuple]) -> int: """ Get the level of nesting of a list or tuple. """ if isinstance(container, (list, tuple)): @@ -485,10 +499,66 @@ def _nesting_level(container: typing.Union[typing.List, typing.Tuple]) -> int: else: return 0 - def _is_nested_iterable( lst): - """ Detect if a list is nested. """ - return any(isinstance(i, list) for i in lst) - + def _force_nesting_list(lst : typing.List) -> list: + """ + Transform a list with nested lists into a list of lists. + + Example: + >>> list_C = [ + 1, 2, 3, 4, # {0;0} + [5, 6], # {1;0} + [7, 8] # {2;0} + ] + >>> _force_nesting_list(list_C) + [[1, 2, 3, 4], [5, 6], [7, 8]] + + :param lst: The list to transform + :return: The transformed list + """ + transformed_list = [] + sublist = [] + + for item in lst: + if isinstance(item, list): + if sublist: + transformed_list.append(sublist) + sublist = [] + transformed_list.append(item) + else: + sublist.append(item) + if sublist: + transformed_list.append(sublist) + + return transformed_list + + def _get_list_shape(lst : typing.List) -> tuple: + """ + Get the shape of a list of lists. + + Example: + >>> list_A = [ + [ + [1, 2], # {0;0} + [3, 4] # {0;1} + ], + [ + [5, 6], # {1;0} + [7, 8] # {1;1} + ] + ] + >>> _get_list_shape(list_A) + (2, 2, 2) + + :param lst: The list to get the shape of + :return: The shape of the list + """ + if isinstance(lst, list): + if len(lst) == 0: + return (0,) + return (len(lst),) + _get_list_shape(lst[0]) + else: + return () + if not self.is_success: return @@ -496,36 +566,69 @@ def _is_nested_iterable( lst): outparam_names = [p.NickName for p in outparam] for idx, outp in enumerate(outparam): - # case: nested lists + # case 1: nested lists if type(self._var_output[idx]) == tuple or type(self._var_output[idx]) == list: - ghenv.Component.Params.Output[idx].VolatileData.Clear() - if _nesting_level(self._var_output[idx]) == 1: - ghenv.Component.Params.Output[idx].AddVolatileDataList(gh.Kernel.Data.GH_Path(0), self._var_output[idx]) - elif _nesting_level(self._var_output[idx]) == 2: - nbr_tuples_aka_branches = len(self._var_output[idx]) - for i in range(nbr_tuples_aka_branches): - ghenv.Component.Params.Output[idx].AddVolatileDataList(gh.Kernel.Data.GH_Path(i), self._var_output[idx][i]) - elif _nesting_level(self._var_output[idx]) > 2: - nbr_tuples_aka_branches = len(self._var_output[idx]) - for i in range(nbr_tuples_aka_branches): - for j in range(len(self._var_output[idx][i])): - ghenv.Component.Params.Output[idx].AddVolatileDataList(gh.Kernel.Data.GH_Path(i, j), self._var_output[idx][i][j]) + self._var_output[idx] = th.list_to_tree(self._var_output[idx]) + + + # ghenv.Component.Params.Output[idx].VolatileData.Clear() + + # list_nest_lvl = _nesting_level(self._var_output[idx]) + + # # case *: force the nesting of the list if it is nested but also with single elements on the first level (e.g. [1, 2, [3, 4]] --> [[1, 2], [3, 4]]) + # if list_nest_lvl >= 2 and _is_first_lvl_nested_iterable(self._var_output[idx]) is False: + # self._var_output[idx] = _force_nesting_list(self._var_output[idx]) + + # # case 1.A: <<< DESCRIPTION >>> + # if list_nest_lvl == 1: + # ghenv.Component.Params.Output[idx].AddVolatileDataList(gh.Kernel.Data.GH_Path(0), self._var_output[idx]) + # # case 1.B: <<< DESCRIPTION >>> + # elif list_nest_lvl == 2: + # nbr_tuples_aka_branches = len(self._var_output[idx]) + # for i in range(nbr_tuples_aka_branches): + # ghenv.Component.Params.Output[idx].AddVolatileDataList(gh.Kernel.Data.GH_Path(i), self._var_output[idx][i]) + # # case 1.C: <<< DESCRIPTION >>> + # elif list_nest_lvl > 2: + + + # # TODO: to be solved + # # >>>>>>>>>>>>>>>>>>>>>>>>> + # list_shape = _get_list_shape(self._var_output[idx]) + # # Create a recursive function to add the volatile data + + + # def add_volatile_data_recursive(output_param, data, path): + # if isinstance(data, list): + # for i, item in enumerate(data): + # new_path = gh.Kernel.Data.GH_Path(path) + # new_path = new_path.AppendElement(i) + # add_volatile_data_recursive(output_param, item, new_path) + # else: + # output_param.AddVolatileData(path, 0, data) # Use index 0 for leaf nodes + + # # Example usage within your existing code + # nbr_tuples_aka_branches = len(self._var_output[idx]) + # for i in range(nbr_tuples_aka_branches): + # path = gh.Kernel.Data.GH_Path(i) + # add_volatile_data_recursive(ghenv.Component.Params.Output[idx], self._var_output[idx][i], path) + # # <<<<<<<<<<<<<<<<<<<<<<<<< + # else: + # case 2: single values + ghenv.Component.Params.Output[idx].VolatileData.Clear() + # case 2.A: the user is returning a Grasshopper.DataTree[System.Object] via the utility ghpythonlib.treehelpers + # e.g.: list_tree = th.list_to_tree(list_A) + # this will be conserve the structure + if type(self._var_output[idx]) == Grasshopper.DataTree[System.Object]: + # self._var_output[idx].SimplifyPaths() + branch_count = self._var_output[idx].BranchCount + for i in range(branch_count): + path = self._var_output[idx].Paths[i] + data = self._var_output[idx].Branch(path) + ghenv.Component.Params.Output[idx].AddVolatileDataList(path, data) + # case 2.B: simple single value else: - ghenv.Component.Params.Output[idx].VolatileData.Clear() - # case: the user is returning a Grasshopper.DataTree[System.Object] via the utility ghpythonlib.treehelpers - # e.g.: list_tree = th.list_to_tree(list_A) - # this will be conserve the structure - if type(self._var_output[idx]) == Grasshopper.DataTree[System.Object]: - self._var_output[idx].SimplifyPaths() - branch_count = self._var_output[idx].BranchCount - for i in range(branch_count): - path = self._var_output[idx].Paths[i] - print(path) - data = self._var_output[idx].Branch(path) - ghenv.Component.Params.Output[idx].AddVolatileDataList(path, data) - # case: simple single value - else: - ghenv.Component.Params.Output[idx].AddVolatileData(gh.Kernel.Data.GH_Path(0), 0, self._var_output[idx]) + ghenv.Component.Params.Output[idx].AddVolatileData(gh.Kernel.Data.GH_Path(0), 0, self._var_output[idx]) + self._var_output.clear() @property