├── .gitignore
├── .gitmodules
├── EZRX.CSharp.Scripting
├── EZRX.CSharp.Scripting.sln
└── EZRX.CSharp.Scripting
│ ├── App.config
│ ├── EZRX.CSharp.Scripting.csproj
│ └── StubProgram.cs
├── EZRX
├── .gitattributes
├── EZRX.cs
├── EZRX.csproj
├── EZRX.sln
├── EZRXInfo.cs
└── Properties
│ └── launchSettings.json
├── EZRX_UI
├── App.config
├── App.xaml
├── App.xaml.cs
├── EZRX_UI.csproj
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── MainWindowViewModel.cs
├── Models.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── RelayCommands.cs
├── hedgehog_icon.jpg
└── packages.config
├── LICENSE
├── README.md
└── lastmessage.txt
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Mono auto generated files
17 | mono_crash.*
18 |
19 | # Build results
20 | [Dd]ebug/
21 | [Dd]ebugPublic/
22 | [Rr]elease/
23 | [Rr]eleases/
24 | x64/
25 | x86/
26 | [Ww][Ii][Nn]32/
27 | [Aa][Rr][Mm]/
28 | [Aa][Rr][Mm]64/
29 | bld/
30 | [Bb]in/
31 | [Oo]bj/
32 | [Ll]og/
33 | [Ll]ogs/
34 |
35 | # Visual Studio 2015/2017 cache/options directory
36 | .vs/
37 | # Uncomment if you have tasks that create the project's static files in wwwroot
38 | #wwwroot/
39 |
40 | # Visual Studio 2017 auto generated files
41 | Generated\ Files/
42 |
43 | # MSTest test Results
44 | [Tt]est[Rr]esult*/
45 | [Bb]uild[Ll]og.*
46 |
47 | # NUnit
48 | *.VisualState.xml
49 | TestResult.xml
50 | nunit-*.xml
51 |
52 | # Build Results of an ATL Project
53 | [Dd]ebugPS/
54 | [Rr]eleasePS/
55 | dlldata.c
56 |
57 | # Benchmark Results
58 | BenchmarkDotNet.Artifacts/
59 |
60 | # .NET Core
61 | project.lock.json
62 | project.fragment.lock.json
63 | artifacts/
64 |
65 | # ASP.NET Scaffolding
66 | ScaffoldingReadMe.txt
67 |
68 | # StyleCop
69 | StyleCopReport.xml
70 |
71 | # Files built by Visual Studio
72 | *_i.c
73 | *_p.c
74 | *_h.h
75 | *.ilk
76 | *.meta
77 | *.obj
78 | *.iobj
79 | *.pch
80 | *.pdb
81 | *.ipdb
82 | *.pgc
83 | *.pgd
84 | *.rsp
85 | *.sbr
86 | *.tlb
87 | *.tli
88 | *.tlh
89 | *.tmp
90 | *.tmp_proj
91 | *_wpftmp.csproj
92 | *.log
93 | *.tlog
94 | *.vspscc
95 | *.vssscc
96 | .builds
97 | *.pidb
98 | *.svclog
99 | *.scc
100 |
101 | # Chutzpah Test files
102 | _Chutzpah*
103 |
104 | # Visual C++ cache files
105 | ipch/
106 | *.aps
107 | *.ncb
108 | *.opendb
109 | *.opensdf
110 | *.sdf
111 | *.cachefile
112 | *.VC.db
113 | *.VC.VC.opendb
114 |
115 | # Visual Studio profiler
116 | *.psess
117 | *.vsp
118 | *.vspx
119 | *.sap
120 |
121 | # Visual Studio Trace Files
122 | *.e2e
123 |
124 | # TFS 2012 Local Workspace
125 | $tf/
126 |
127 | # Guidance Automation Toolkit
128 | *.gpState
129 |
130 | # ReSharper is a .NET coding add-in
131 | _ReSharper*/
132 | *.[Rr]e[Ss]harper
133 | *.DotSettings.user
134 |
135 | # TeamCity is a build add-in
136 | _TeamCity*
137 |
138 | # DotCover is a Code Coverage Tool
139 | *.dotCover
140 |
141 | # AxoCover is a Code Coverage Tool
142 | .axoCover/*
143 | !.axoCover/settings.json
144 |
145 | # Coverlet is a free, cross platform Code Coverage Tool
146 | coverage*.json
147 | coverage*.xml
148 | coverage*.info
149 |
150 | # Visual Studio code coverage results
151 | *.coverage
152 | *.coveragexml
153 |
154 | # NCrunch
155 | _NCrunch_*
156 | .*crunch*.local.xml
157 | nCrunchTemp_*
158 |
159 | # MightyMoose
160 | *.mm.*
161 | AutoTest.Net/
162 |
163 | # Web workbench (sass)
164 | .sass-cache/
165 |
166 | # Installshield output folder
167 | [Ee]xpress/
168 |
169 | # DocProject is a documentation generator add-in
170 | DocProject/buildhelp/
171 | DocProject/Help/*.HxT
172 | DocProject/Help/*.HxC
173 | DocProject/Help/*.hhc
174 | DocProject/Help/*.hhk
175 | DocProject/Help/*.hhp
176 | DocProject/Help/Html2
177 | DocProject/Help/html
178 |
179 | # Click-Once directory
180 | publish/
181 |
182 | # Publish Web Output
183 | *.[Pp]ublish.xml
184 | *.azurePubxml
185 | # Note: Comment the next line if you want to checkin your web deploy settings,
186 | # but database connection strings (with potential passwords) will be unencrypted
187 | *.pubxml
188 | *.publishproj
189 |
190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
191 | # checkin your Azure Web App publish settings, but sensitive information contained
192 | # in these scripts will be unencrypted
193 | PublishScripts/
194 |
195 | # NuGet Packages
196 | *.nupkg
197 | # NuGet Symbol Packages
198 | *.snupkg
199 | # The packages folder can be ignored because of Package Restore
200 | **/[Pp]ackages/*
201 | # except build/, which is used as an MSBuild target.
202 | !**/[Pp]ackages/build/
203 | # Uncomment if necessary however generally it will be regenerated when needed
204 | #!**/[Pp]ackages/repositories.config
205 | # NuGet v3's project.json files produces more ignorable files
206 | *.nuget.props
207 | *.nuget.targets
208 |
209 | # Microsoft Azure Build Output
210 | csx/
211 | *.build.csdef
212 |
213 | # Microsoft Azure Emulator
214 | ecf/
215 | rcf/
216 |
217 | # Windows Store app package directories and files
218 | AppPackages/
219 | BundleArtifacts/
220 | Package.StoreAssociation.xml
221 | _pkginfo.txt
222 | *.appx
223 | *.appxbundle
224 | *.appxupload
225 |
226 | # Visual Studio cache files
227 | # files ending in .cache can be ignored
228 | *.[Cc]ache
229 | # but keep track of directories ending in .cache
230 | !?*.[Cc]ache/
231 |
232 | # Others
233 | ClientBin/
234 | ~$*
235 | *~
236 | *.dbmdl
237 | *.dbproj.schemaview
238 | *.jfm
239 | *.pfx
240 | *.publishsettings
241 | orleans.codegen.cs
242 |
243 | # Including strong name files can present a security risk
244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
245 | #*.snk
246 |
247 | # Since there are multiple workflows, uncomment next line to ignore bower_components
248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
249 | #bower_components/
250 |
251 | # RIA/Silverlight projects
252 | Generated_Code/
253 |
254 | # Backup & report files from converting an old project file
255 | # to a newer Visual Studio version. Backup files are not needed,
256 | # because we have git ;-)
257 | _UpgradeReport_Files/
258 | Backup*/
259 | UpgradeLog*.XML
260 | UpgradeLog*.htm
261 | ServiceFabricBackup/
262 | *.rptproj.bak
263 |
264 | # SQL Server files
265 | *.mdf
266 | *.ldf
267 | *.ndf
268 |
269 | # Business Intelligence projects
270 | *.rdl.data
271 | *.bim.layout
272 | *.bim_*.settings
273 | *.rptproj.rsuser
274 | *- [Bb]ackup.rdl
275 | *- [Bb]ackup ([0-9]).rdl
276 | *- [Bb]ackup ([0-9][0-9]).rdl
277 |
278 | # Microsoft Fakes
279 | FakesAssemblies/
280 |
281 | # GhostDoc plugin setting file
282 | *.GhostDoc.xml
283 |
284 | # Node.js Tools for Visual Studio
285 | .ntvs_analysis.dat
286 | node_modules/
287 |
288 | # Visual Studio 6 build log
289 | *.plg
290 |
291 | # Visual Studio 6 workspace options file
292 | *.opt
293 |
294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
295 | *.vbw
296 |
297 | # Visual Studio 6 auto-generated project file (contains which files were open etc.)
298 | *.vbp
299 |
300 | # Visual Studio 6 workspace and project file (working project files containing files to include in project)
301 | *.dsw
302 | *.dsp
303 |
304 | # Visual Studio 6 technical files
305 | *.ncb
306 | *.aps
307 |
308 | # Visual Studio LightSwitch build output
309 | **/*.HTMLClient/GeneratedArtifacts
310 | **/*.DesktopClient/GeneratedArtifacts
311 | **/*.DesktopClient/ModelManifest.xml
312 | **/*.Server/GeneratedArtifacts
313 | **/*.Server/ModelManifest.xml
314 | _Pvt_Extensions
315 |
316 | # Paket dependency manager
317 | .paket/paket.exe
318 | paket-files/
319 |
320 | # FAKE - F# Make
321 | .fake/
322 |
323 | # CodeRush personal settings
324 | .cr/personal
325 |
326 | # Python Tools for Visual Studio (PTVS)
327 | __pycache__/
328 | *.pyc
329 |
330 | # Cake - Uncomment if you are using it
331 | # tools/**
332 | # !tools/packages.config
333 |
334 | # Tabs Studio
335 | *.tss
336 |
337 | # Telerik's JustMock configuration file
338 | *.jmconfig
339 |
340 | # BizTalk build output
341 | *.btp.cs
342 | *.btm.cs
343 | *.odx.cs
344 | *.xsd.cs
345 |
346 | # OpenCover UI analysis results
347 | OpenCover/
348 |
349 | # Azure Stream Analytics local run output
350 | ASALocalRun/
351 |
352 | # MSBuild Binary and Structured Log
353 | *.binlog
354 |
355 | # NVidia Nsight GPU debugger configuration file
356 | *.nvuser
357 |
358 | # MFractors (Xamarin productivity tool) working folder
359 | .mfractor/
360 |
361 | # Local History for Visual Studio
362 | .localhistory/
363 |
364 | # Visual Studio History (VSHistory) files
365 | .vshistory/
366 |
367 | # BeatPulse healthcheck temp database
368 | healthchecksdb
369 |
370 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
371 | MigrationBackup/
372 |
373 | # Ionide (cross platform F# VS Code tools) working folder
374 | .ionide/
375 |
376 | # Fody - auto-generated XML schema
377 | FodyWeavers.xsd
378 |
379 | # VS Code files for those working on multiple tools
380 | .vscode/*
381 | !.vscode/settings.json
382 | !.vscode/tasks.json
383 | !.vscode/launch.json
384 | !.vscode/extensions.json
385 | *.code-workspace
386 |
387 | # Local History for Visual Studio Code
388 | .history/
389 |
390 | # Windows Installer files from build outputs
391 | *.cab
392 | *.msi
393 | *.msix
394 | *.msm
395 | *.msp
396 |
397 | # JetBrains Rider
398 | *.sln.iml
399 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "ara3d"]
2 | path = ara3d
3 | url = https://github.com/ara3d/ara3d
4 |
--------------------------------------------------------------------------------
/EZRX.CSharp.Scripting/EZRX.CSharp.Scripting.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.4.33122.133
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EZRX.CSharp.Scripting", "EZRX.CSharp.Scripting\EZRX.CSharp.Scripting.csproj", "{63332FA0-B995-41CD-8A3D-3654AFB0255F}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ezrx.Rhino", "..\ara3d\labs\Ezrx.Rhino\Ezrx.Rhino.csproj", "{C722A3BC-C881-4AE0-A61D-E6EBA05604B5}"
9 | EndProject
10 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ara3D.Utils", "..\ara3d\src\Ara3D.Utils\Ara3D.Utils.csproj", "{A3E6543F-DBA8-4092-A57D-9D242283B301}"
11 | EndProject
12 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ara3D.Utils.Roslyn", "..\ara3d\src\Ara3D.Utils.Roslyn\Ara3D.Utils.Roslyn.csproj", "{D78FF49C-774B-40D2-8407-5D1C82E187E5}"
13 | EndProject
14 | Global
15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
16 | Debug|Any CPU = Debug|Any CPU
17 | Release|Any CPU = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
20 | {63332FA0-B995-41CD-8A3D-3654AFB0255F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {63332FA0-B995-41CD-8A3D-3654AFB0255F}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {63332FA0-B995-41CD-8A3D-3654AFB0255F}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {63332FA0-B995-41CD-8A3D-3654AFB0255F}.Release|Any CPU.Build.0 = Release|Any CPU
24 | {C722A3BC-C881-4AE0-A61D-E6EBA05604B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25 | {C722A3BC-C881-4AE0-A61D-E6EBA05604B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
26 | {C722A3BC-C881-4AE0-A61D-E6EBA05604B5}.Release|Any CPU.ActiveCfg = Release|Any CPU
27 | {C722A3BC-C881-4AE0-A61D-E6EBA05604B5}.Release|Any CPU.Build.0 = Release|Any CPU
28 | {A3E6543F-DBA8-4092-A57D-9D242283B301}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
29 | {A3E6543F-DBA8-4092-A57D-9D242283B301}.Debug|Any CPU.Build.0 = Debug|Any CPU
30 | {A3E6543F-DBA8-4092-A57D-9D242283B301}.Release|Any CPU.ActiveCfg = Release|Any CPU
31 | {A3E6543F-DBA8-4092-A57D-9D242283B301}.Release|Any CPU.Build.0 = Release|Any CPU
32 | {D78FF49C-774B-40D2-8407-5D1C82E187E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33 | {D78FF49C-774B-40D2-8407-5D1C82E187E5}.Debug|Any CPU.Build.0 = Debug|Any CPU
34 | {D78FF49C-774B-40D2-8407-5D1C82E187E5}.Release|Any CPU.ActiveCfg = Release|Any CPU
35 | {D78FF49C-774B-40D2-8407-5D1C82E187E5}.Release|Any CPU.Build.0 = Release|Any CPU
36 | EndGlobalSection
37 | GlobalSection(SolutionProperties) = preSolution
38 | HideSolutionNode = FALSE
39 | EndGlobalSection
40 | GlobalSection(ExtensibilityGlobals) = postSolution
41 | SolutionGuid = {CE1D9BC7-6646-4FF2-9E49-F1476041788E}
42 | EndGlobalSection
43 | EndGlobal
44 |
--------------------------------------------------------------------------------
/EZRX.CSharp.Scripting/EZRX.CSharp.Scripting/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/EZRX.CSharp.Scripting/EZRX.CSharp.Scripting/EZRX.CSharp.Scripting.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {63332FA0-B995-41CD-8A3D-3654AFB0255F}
8 | Exe
9 | EZRX.CSharp.Scripting
10 | EZRX.CSharp.Scripting
11 | v4.8
12 | 512
13 | true
14 | true
15 |
16 |
17 | AnyCPU
18 | true
19 | full
20 | false
21 | bin\Debug\
22 | DEBUG;TRACE
23 | prompt
24 | 4
25 |
26 |
27 | AnyCPU
28 | pdbonly
29 | true
30 | bin\Release\
31 | TRACE
32 | prompt
33 | 4
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/EZRX.CSharp.Scripting/EZRX.CSharp.Scripting/StubProgram.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace EZRX.CSharp.Scripting
8 | {
9 | public static class StubProgram
10 | {
11 | public static void Main()
12 | {
13 | Console.WriteLine($"Hello world");
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/EZRX/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/EZRX/EZRX.cs:
--------------------------------------------------------------------------------
1 | using OpenAI_API;
2 | using OpenAI_API.Chat;
3 | using System;
4 | using System.Collections.Generic;
5 | using Ezrx.Rhino;
6 | using EZRX_UI;
7 | using Grasshopper;
8 | using Grasshopper.Kernel;
9 | using Rhino.Geometry;
10 | using System.IO;
11 |
12 | namespace EZRX
13 | {
14 | public class EZRX : GH_Component
15 | {
16 | ///
17 | /// Each implementation of GH_Component must provide a public
18 | /// constructor without any arguments.
19 | /// Category represents the Tab in which the component will appear,
20 | /// Subcategory the panel. If you use non-existing tab or panel names,
21 | /// new tabs/panels will automatically be created.
22 | ///
23 | public EZRX()
24 | : base("EZRX", "Nickname",
25 | "Description",
26 | "Category", "Subcategory")
27 | {
28 | }
29 |
30 | ///
31 | /// Registers all the input parameters for this component.
32 | ///
33 | protected override void RegisterInputParams(GH_Component.GH_InputParamManager pManager)
34 | {
35 | }
36 |
37 | ///
38 | /// Registers all the output parameters for this component.
39 | ///
40 | protected override void RegisterOutputParams(GH_Component.GH_OutputParamManager pManager)
41 | {
42 | pManager.AddMeshParameter("Mesh", "Mesh", "Mesh Output", GH_ParamAccess.item);
43 | }
44 |
45 | ///
46 | /// This is the method that actually does the work.
47 | ///
48 | /// The DA object can be used to retrieve data from input parameters and
49 | /// to store data in output parameters.
50 | protected override void SolveInstance(IGH_DataAccess DA)
51 | {
52 |
53 | var window = new MainWindow();
54 | window.ShowDialog();
55 |
56 | string path = Path.Combine(Directory.GetCurrentDirectory(), @"..\..\..\..\", "lastmessage.txt");
57 | //string filePath = @"C:\Users\tpotter\Desktop\EZRX\Tests\TestCube.txt";
58 | var rhinoReader = Evaluator.EvalFile(path);
59 |
60 | //var result = InputBox.Show("Give me the file path", "", ref value);
61 |
62 |
63 | DA.SetData(0, rhinoReader);
64 | }
65 |
66 | ///
67 | /// Provides an Icon for every component that will be visible in the User Interface.
68 | /// Icons need to be 24x24 pixels.
69 | /// You can add image files to your project resources and access them like this:
70 | /// return Resources.IconForThisComponent;
71 | ///
72 | protected override System.Drawing.Bitmap Icon => null;
73 |
74 | ///
75 | /// Each component must have a unique Guid to identify it.
76 | /// It is vital this Guid doesn't change otherwise old ghx files
77 | /// that use the old ID will partially fail during loading.
78 | ///
79 | public override Guid ComponentGuid => new Guid("bf4a2cab-00d2-49d1-b26b-9985622afbb2");
80 | }
81 | }
--------------------------------------------------------------------------------
/EZRX/EZRX.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net48
5 | 1.0
6 | EZRX
7 | Description of EZRX
8 | .gha
9 | true
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | obj\Debug\net48\Ezrx.Rhino.dll
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/EZRX/EZRX.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.7.34221.43
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EZRX", "EZRX.csproj", "{F59B00FD-3581-4D5C-9F25-03E5AD6517BC}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EZRX_UI", "..\EZRX_UI\EZRX_UI.csproj", "{80EC1EF3-274A-4F15-829E-8EA54B6C6ED3}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Release|Any CPU = Release|Any CPU
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {F59B00FD-3581-4D5C-9F25-03E5AD6517BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {F59B00FD-3581-4D5C-9F25-03E5AD6517BC}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {F59B00FD-3581-4D5C-9F25-03E5AD6517BC}.Release|Any CPU.ActiveCfg = Release|Any CPU
19 | {F59B00FD-3581-4D5C-9F25-03E5AD6517BC}.Release|Any CPU.Build.0 = Release|Any CPU
20 | {80EC1EF3-274A-4F15-829E-8EA54B6C6ED3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {80EC1EF3-274A-4F15-829E-8EA54B6C6ED3}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {80EC1EF3-274A-4F15-829E-8EA54B6C6ED3}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {80EC1EF3-274A-4F15-829E-8EA54B6C6ED3}.Release|Any CPU.Build.0 = Release|Any CPU
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | GlobalSection(ExtensibilityGlobals) = postSolution
29 | SolutionGuid = {17141EAA-0EEE-4D86-B731-622F021DD8CA}
30 | EndGlobalSection
31 | EndGlobal
32 |
--------------------------------------------------------------------------------
/EZRX/EZRXInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Drawing;
3 | using Grasshopper;
4 | using Grasshopper.Kernel;
5 |
6 | namespace EZRX
7 | {
8 | public class EZRXInfo : GH_AssemblyInfo
9 | {
10 | public override string Name => "EZRX";
11 |
12 | //Return a 24x24 pixel bitmap to represent this GHA library.
13 | public override Bitmap Icon => null;
14 |
15 | //Return a short string describing the purpose of this GHA library.
16 | public override string Description => "";
17 |
18 | public override Guid Id => new Guid("46f42c05-117b-4e6a-993e-0461ab64c325");
19 |
20 | //Return a string identifying you or your company.
21 | public override string AuthorName => "";
22 |
23 | //Return a string representing your preferred contact details.
24 | public override string AuthorContact => "";
25 | }
26 | }
--------------------------------------------------------------------------------
/EZRX/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "EZRX": {
4 | "commandName": "Executable",
5 | "executablePath": "C:\\Program Files\\Rhino 7\\System\\Rhino.exe",
6 | "commandLineArgs": ""
7 | }
8 | }
9 | }
--------------------------------------------------------------------------------
/EZRX_UI/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/EZRX_UI/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/EZRX_UI/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace EZRX_UI
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/EZRX_UI/EZRX_UI.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {80EC1EF3-274A-4F15-829E-8EA54B6C6ED3}
8 | WinExe
9 | EZRX_UI
10 | EZRX_UI
11 | v4.8
12 | 512
13 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
14 | 4
15 | true
16 | true
17 |
18 |
19 |
20 | AnyCPU
21 | true
22 | full
23 | false
24 | bin\Debug\
25 | DEBUG;TRACE
26 | prompt
27 | 4
28 |
29 |
30 | AnyCPU
31 | pdbonly
32 | true
33 | bin\Release\
34 | TRACE
35 | prompt
36 | 4
37 |
38 |
39 |
40 | ..\EZRX\packages\Microsoft.Bcl.AsyncInterfaces.1.1.1\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll
41 |
42 |
43 | ..\EZRX\packages\Microsoft.Extensions.Configuration.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.dll
44 |
45 |
46 | ..\EZRX\packages\Microsoft.Extensions.Configuration.Abstractions.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.Abstractions.dll
47 |
48 |
49 | ..\EZRX\packages\Microsoft.Extensions.Configuration.Binder.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.Binder.dll
50 |
51 |
52 | ..\EZRX\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll
53 |
54 |
55 | ..\EZRX\packages\Microsoft.Extensions.Http.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Http.dll
56 |
57 |
58 | ..\EZRX\packages\Microsoft.Extensions.Logging.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Logging.dll
59 |
60 |
61 | ..\EZRX\packages\Microsoft.Extensions.Logging.Abstractions.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll
62 |
63 |
64 | ..\EZRX\packages\Microsoft.Extensions.Options.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Options.dll
65 |
66 |
67 | ..\EZRX\packages\Microsoft.Extensions.Primitives.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Primitives.dll
68 |
69 |
70 | ..\EZRX\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll
71 |
72 |
73 | ..\EZRX\packages\OpenAI.1.7.2\lib\netstandard2.0\OpenAI_API.dll
74 |
75 |
76 |
77 | ..\EZRX\packages\System.Buffers.4.4.0\lib\netstandard2.0\System.Buffers.dll
78 |
79 |
80 |
81 | ..\EZRX\packages\System.Memory.4.5.0\lib\netstandard2.0\System.Memory.dll
82 |
83 |
84 |
85 | ..\EZRX\packages\System.Numerics.Vectors.4.4.0\lib\net46\System.Numerics.Vectors.dll
86 |
87 |
88 | ..\EZRX\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll
89 |
90 |
91 | ..\EZRX\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 | 4.0
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 | MSBuild:Compile
109 | Designer
110 |
111 |
112 |
113 | MSBuild:Compile
114 | Designer
115 |
116 |
117 | App.xaml
118 | Code
119 |
120 |
121 | MainWindow.xaml
122 | Code
123 |
124 |
125 |
126 |
127 |
128 |
129 | Code
130 |
131 |
132 | True
133 | True
134 | Resources.resx
135 |
136 |
137 | True
138 | Settings.settings
139 | True
140 |
141 |
142 | ResXFileCodeGenerator
143 | Resources.Designer.cs
144 |
145 |
146 |
147 | SettingsSingleFileGenerator
148 | Settings.Designer.cs
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 | xcopy "$(TargetDir)$(TargetFileName)" "C:\Users\tpotter\Desktop\EZRX\EZRX\obj\Debug\net48" /Y
160 |
161 |
--------------------------------------------------------------------------------
/EZRX_UI/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
10 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
26 |
27 |
33 |
34 |
37 |
38 |
39 |
40 |
41 |
45 |
49 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
65 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
83 |
86 |
87 |
95 |
96 |
97 |
104 |
105 |
106 |
--------------------------------------------------------------------------------
/EZRX_UI/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace EZRX_UI
17 | {
18 | ///
19 | /// Interaction logic for MainWindow.xaml
20 | ///
21 | public partial class MainWindow : Window
22 | {
23 | public MainWindow()
24 | {
25 | this.DataContext = new MainWindowViewModel();
26 | InitializeComponent();
27 | }
28 |
29 | private void Button_KeyUp(object sender, KeyEventArgs e)
30 | {
31 | if (e.Key == Key.Enter)
32 | {
33 | this.DataContext.GetType().GetMethod("SendPrompt").Invoke(this.DataContext, null);
34 | }
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/EZRX_UI/MainWindowViewModel.cs:
--------------------------------------------------------------------------------
1 | using OpenAI_API;
2 | using OpenAI_API.Chat;
3 | using OpenAI_API.Models;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Collections.ObjectModel;
7 | using System.ComponentModel;
8 | using System.IO;
9 | using System.Linq;
10 | using System.Security;
11 | using System.Text;
12 | using System.Threading.Tasks;
13 | using System.Windows.Input;
14 |
15 | namespace EZRX_UI
16 | {
17 | public class MainWindowViewModel : INotifyPropertyChanged
18 | {
19 | public ObservableCollection m_Prompts { get; private set; }
20 | public ObservableCollection Prompts
21 | {
22 | get { return m_Prompts; }
23 | set { m_Prompts = value; OnPropertyChanged(nameof(Prompts)); }
24 | }
25 |
26 |
27 | public string m_Code { get; private set; }
28 | public string Code
29 | {
30 | get { return m_Code; }
31 | set { m_Code = value; OnPropertyChanged(nameof(Code)); }
32 | }
33 |
34 | public string m_Prompt { get; private set; }
35 | public string Prompt
36 | {
37 | get { return m_Prompt; }
38 | set { m_Prompt = value; OnPropertyChanged(nameof(Prompt)); }
39 | }
40 | public ICommand SendMessageCommand { get; private set; }
41 | public ICommand ExecuteCommand { get; private set; }
42 |
43 | public MainWindowViewModel()
44 |
45 | {
46 | Prompts = new ObservableCollection() {};
47 | Code = "Ask EZRX for help!";
48 | StartAPI();
49 | SendMessageCommand = new RelayCommand(SendPrompt);
50 | ExecuteCommand = new RelayCommand(Execute);
51 | }
52 |
53 | public event PropertyChangedEventHandler PropertyChanged;
54 | protected virtual void OnPropertyChanged(string propertyName)
55 | {
56 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
57 | }
58 |
59 |
60 |
61 | /******************************************************/
62 | /***** Private Methods *****/
63 | /******************************************************/
64 |
65 | private Conversation m_Chat { get; set; }
66 | public Conversation Chat
67 | {
68 | get { return m_Chat; }
69 | set { m_Chat = value; }
70 | }
71 |
72 |
73 | private void StartAPI()
74 | {
75 | string modelName = "gpt-4-1106-preview";
76 |
77 | OpenAIAPI api = new OpenAIAPI("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");
78 |
79 | ChatRequest chatRequest = new ChatRequest
80 | {
81 | Model = modelName // Replace with the model version you want to use, e.g., "davinci", "curie", etc.
82 | };
83 | var chat = api.Chat.CreateConversation(chatRequest);
84 |
85 | //chat.AppendSystemMessage("You have only one purpose: to provide me with C# code that will run directly within a Grasshopper C# Script Node. Do not provide code for creating Grasshopper components. I don't want any other comments. Do not say \"here is your code\" or similar remarks. Just answer with the code itself off the bait");
86 | chat.AppendSystemMessage(
87 | "Give me C# code that will run directly within a Grasshopper C# Script Node. " +
88 | "I want it as plain text, so do not wrap it as code. Do not explain the code or say anything at all." +
89 | "Do not provide code for creating Grasshopper components." +
90 | "The code you respond with should be a function of no parameters, within a class, within a namespace, with all required using statements at the top." +
91 | "The function should always return a Rhino Geometry Mesh."
92 | );
93 | Chat = chat;
94 | }
95 |
96 | private async void SendPrompt()
97 | {
98 | //send messages to the chatbot
99 | Prompts.Add(new Chat() { Message = m_Prompt });
100 | Chat.AppendUserInput(Prompts.LastOrDefault().Message);
101 |
102 | await OpenAPI();
103 |
104 | Prompt = "";
105 | //send message to open api call
106 |
107 | //get response from open api call
108 |
109 | //update the textblock for Code
110 | }
111 |
112 | private void Execute()
113 | {
114 |
115 | }
116 |
117 | async Task OpenAPI()
118 | {
119 | string response = await Chat.GetResponseFromChatbotAsync();
120 | Code = response;
121 | //SaveStringToTextFile(Code);
122 | Chat.AppendExampleChatbotOutput(response);
123 | }
124 |
125 | public void SaveStringToTextFile(string myString)
126 | {
127 | string fileName = "lastmessage.txt";
128 | string path = Path.Combine(Directory.GetCurrentDirectory(), @"..\..\..\..\", fileName);
129 | File.WriteAllText(path, myString);
130 | }
131 |
132 | public string ReadStringFromTextFile(string fileName)
133 | {
134 | string filePath = Path.Combine(Directory.GetCurrentDirectory(), @"..\..\..\..\", fileName);
135 | string str = File.ReadAllText(filePath);
136 | return str;
137 | }
138 | }
139 | }
140 |
--------------------------------------------------------------------------------
/EZRX_UI/Models.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace EZRX_UI
8 | {
9 | public class Main
10 | {
11 | }
12 |
13 | public class Chat
14 | {
15 | public string Message { get; set; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/EZRX_UI/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 | using System.Windows;
6 |
7 | // General Information about an assembly is controlled through the following
8 | // set of attributes. Change these attribute values to modify the information
9 | // associated with an assembly.
10 | [assembly: AssemblyTitle("EZRX_UI")]
11 | [assembly: AssemblyDescription("")]
12 | [assembly: AssemblyConfiguration("")]
13 | [assembly: AssemblyCompany("BuroHappold Engineering")]
14 | [assembly: AssemblyProduct("EZRX_UI")]
15 | [assembly: AssemblyCopyright("Copyright © BuroHappold Engineering 2023")]
16 | [assembly: AssemblyTrademark("")]
17 | [assembly: AssemblyCulture("")]
18 |
19 | // Setting ComVisible to false makes the types in this assembly not visible
20 | // to COM components. If you need to access a type in this assembly from
21 | // COM, set the ComVisible attribute to true on that type.
22 | [assembly: ComVisible(false)]
23 |
24 | //In order to begin building localizable applications, set
25 | //CultureYouAreCodingWith in your .csproj file
26 | //inside a . For example, if you are using US english
27 | //in your source files, set the to en-US. Then uncomment
28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in
29 | //the line below to match the UICulture setting in the project file.
30 |
31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32 |
33 |
34 | [assembly: ThemeInfo(
35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
36 | //(used if a resource is not found in the page,
37 | // or application resource dictionaries)
38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
39 | //(used if a resource is not found in the page,
40 | // app, or any theme specific resource dictionaries)
41 | )]
42 |
43 |
44 | // Version information for an assembly consists of the following four values:
45 | //
46 | // Major Version
47 | // Minor Version
48 | // Build Number
49 | // Revision
50 | //
51 | // You can specify all the values or you can default the Build and Revision Numbers
52 | // by using the '*' as shown below:
53 | // [assembly: AssemblyVersion("1.0.*")]
54 | [assembly: AssemblyVersion("1.0.0.0")]
55 | [assembly: AssemblyFileVersion("1.0.0.0")]
56 |
--------------------------------------------------------------------------------
/EZRX_UI/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace EZRX_UI.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("EZRX_UI.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/EZRX_UI/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/EZRX_UI/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace EZRX_UI.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.7.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/EZRX_UI/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/EZRX_UI/RelayCommands.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows.Input;
7 |
8 | namespace EZRX_UI
9 | {
10 | public class RelayCommand : ICommand
11 | {
12 | private Action _execute;
13 | private Func _canExecute;
14 |
15 | public RelayCommand(Action execute, Func canExecute = null)
16 | {
17 | _execute = execute;
18 | _canExecute = canExecute;
19 | }
20 |
21 | public event EventHandler CanExecuteChanged;
22 |
23 | public bool CanExecute(object parameter)
24 | {
25 | return _canExecute == null || _canExecute();
26 | }
27 |
28 | public void Execute(object parameter)
29 | {
30 | _execute();
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/EZRX_UI/hedgehog_icon.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EZ-Script/EZRX-Scripting/3547cc394d8194c816cab108bb31665a4b4567b0/EZRX_UI/hedgehog_icon.jpg
--------------------------------------------------------------------------------
/EZRX_UI/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 EZ-Script
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # EZRX-Scripting
2 |
3 |
4 |
5 | # Overview
6 |
7 | EZRX is a plug-in for Rhino that helps a user use Chat GPT to create scripted Grasshopper nodes. We built this for the AEC Tech 2023 Hackathon in New York hosted by CORE studio and Thornton Thomasetti.
8 |
9 |
10 |
11 | # Background and Motivation
12 |
13 | Architects don't have time or motivation to learn to code, but would benefit from using scripts for creating reproducible workflows and more complex forms.
14 |
15 |
16 |
17 | Today an architect can use Chat GPT to request code, but someone without programming experience can find it hard to get Chat GPT to produce working code.
18 | They need to provide sufficient context with the prompt to get a working result.
19 |
20 | # What we did
21 |
22 | A lot of our time was spent as a group trying to understand narrow down our original mandate of "making coding easier". We wanted to understand what that
23 | meant exactly, how we might achieve that, which persona we wanted to focus on and what use case we were targetting.
24 |
25 | Once we arrived at the we designed and coded three primary components:
26 |
27 | * A tool for generating grasshopper nodes that dynamically compile and execute arbitrary C# code read from a file
28 | * An API for sending prompts to and reading responses of the Chat GPT API, with additional context provided to prompt to produce better code
29 | * A UI to allow the user to provide a prompt and review the generated code, before generating a node from it
30 |
31 | # Architecture Overview
32 |
33 |
34 |
35 | # Libraries used
36 |
37 | * Rhino API - For creating Grasshopper nodes
38 | * Roslyn SDK - C# Compiler
39 | * [Ara3D Library](https://github.com/ara3d/ara3d) - utility library and convenience functions
40 | * [OpenAI Unoffical .NET API](https://github.com/OkGoDoIt/OpenAI-API-dotnet)
41 |
42 | # Cloning the Repository
43 |
44 | This module used the `github.com\ara3d\ara3d` project as a submodule.
45 |
46 | From the command-line you can pull the submodules using:
47 |
48 | ```
49 | git submodule update --init --recursive
50 | ```
51 |
52 | # Building and Running the Code
53 |
54 | We only had time to get the code running on one user's machine and
55 | unfortunately do not have the steps documented to run the system.
56 |
57 | # What we learned
58 |
59 | * Don't post API keys to Github
60 | * If you accidentally post your OpenAPI API key to Github, OpenAPI will revoke it very quickly!
61 | * Don't ask too much from your prompt or it can get confused
62 | * Chat GPT 4 is much more powerful than GPT 3.5 and can handle more complex requests
63 | * Getting working code requires providing a lot of additional context
64 | * We found that the unofficial OpenAPI .NET worked better than the official one.
65 | * How you phrase a prompt makes a big difference
66 | * ChatGPT will not always produce the same results.
67 | * Architects don't necessarily want to learn to code, they want to realize their designs quicker
68 |
69 | # Next Steps
70 |
71 | We only had 26 hours to write the code and submit the presentation so there is a lot left to do.
72 |
73 | ## Technical Debt and Code Clean-up
74 | * Test the system on other person's machine
75 | * Refactor the code to make it easier to run and modify
76 | * Create an installer
77 | * Document the build process
78 |
79 | ## Features
80 |
81 | * Storing prompts and the results and making them searchable
82 | * Supporting different output types other than just mesh
83 | * Allowing customized inputs
84 | * Allow the prompt contexts to be updated by the user
85 | * Allow the generated code to be used in other context
86 | * Train models to create and recognize a generic structure for describing inputs/outputs
87 |
88 |
89 |
90 | # Who are We
91 |
92 | We are the EZ Script team.
93 | * Christopher Diggins - Software Developer
94 | * Emma Xu - Architecture Student
95 | * Travis Potter - Software Engineer and MEP Engineer
96 | * Haki Sallaku - Computer Science Student
97 | * Sun Lee - Computational Designer and Architect
98 | * Bell Wang - Architecture Student
99 | * Marcelo Villalba - Software Engineer
100 |
101 | 
102 |
103 |
104 |
105 |
--------------------------------------------------------------------------------
/lastmessage.txt:
--------------------------------------------------------------------------------
1 | using Rhino.Geometry;
2 | namespace Test {
3 | public class TestClass {
4 | public Mesh CreateCube() {
5 | var mesh = new Mesh();
6 | mesh.Vertices.Add(new Point3d(0.5, 0.5, 0.5));
7 | mesh.Vertices.Add(new Point3d(0.5, 0.5, -0.5));
8 | mesh.Vertices.Add(new Point3d(0.5, -0.5, 0.5));
9 | mesh.Vertices.Add(new Point3d(0.5, -0.5, -0.5));
10 | mesh.Vertices.Add(new Point3d(-0.5, 0.5, 0.5));
11 | mesh.Vertices.Add(new Point3d(-0.5, 0.5, -0.5));
12 | mesh.Vertices.Add(new Point3d(-0.5, -0.5, 0.5));
13 | mesh.Vertices.Add(new Point3d(-0.5, -0.5, -0.5));
14 | mesh.Faces.AddFace(0, 1, 5, 4);
15 | mesh.Faces.AddFace(0, 4, 6, 2);
16 | mesh.Faces.AddFace(0, 2, 3, 1);
17 | mesh.Faces.AddFace(7, 3, 2, 6);
18 | mesh.Faces.AddFace(7, 6, 4, 5);
19 | mesh.Faces.AddFace(7, 5, 1, 3);
20 | mesh.FaceNormals.ComputeFaceNormals();
21 | mesh.Normals.ComputeNormals();
22 | mesh.Compact();
23 | return mesh;
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------