From e8bcebdda1dabdd5cc2bbaa7b0bf84a79aa9b267 Mon Sep 17 00:00:00 2001 From: Alan Rynne Date: Wed, 30 Jun 2021 13:14:48 +0200 Subject: [PATCH] Initial boilerplate commit --- .gitignore | 5 ++++ CSharpStarter/CSharpStarter.csproj | 13 +++++++++++ CSharpStarter/Program.cs | 37 ++++++++++++++++++++++++++++++ CSharpStarter/Readme.md | 12 ++++++++++ PythonStarter/Readme.md | 0 README.md | 1 + WebStarter/Readme.md | 0 WebStarter/app.js | 7 ++++++ WebStarter/index.html | 20 ++++++++++++++++ WebStarter/styles.css | 15 ++++++++++++ 10 files changed, 110 insertions(+) create mode 100644 .gitignore create mode 100644 CSharpStarter/CSharpStarter.csproj create mode 100644 CSharpStarter/Program.cs create mode 100644 CSharpStarter/Readme.md create mode 100644 PythonStarter/Readme.md create mode 100644 README.md create mode 100644 WebStarter/Readme.md create mode 100644 WebStarter/app.js create mode 100644 WebStarter/index.html create mode 100644 WebStarter/styles.css diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9cc8d33 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +**/bin/ +**/obj/ + +**/.vscode/ +**/.DS_Store \ No newline at end of file diff --git a/CSharpStarter/CSharpStarter.csproj b/CSharpStarter/CSharpStarter.csproj new file mode 100644 index 0000000..a9dc609 --- /dev/null +++ b/CSharpStarter/CSharpStarter.csproj @@ -0,0 +1,13 @@ + + + + Exe + netcoreapp3.1 + + + + + + + + diff --git a/CSharpStarter/Program.cs b/CSharpStarter/Program.cs new file mode 100644 index 0000000..630b99e --- /dev/null +++ b/CSharpStarter/Program.cs @@ -0,0 +1,37 @@ +using System; +using Speckle.Core.Kits; +using Speckle.Core.Credentials; +using Speckle.Core.Api; +using Objects; +using Speckle.Core.Models; +using System.Collections.Generic; +using System.Threading.Tasks; +using Objects.Geometry; +using Objects.Primitive; + +namespace CSharpStarter +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("Hello Speckle!"); + + // Get default account on this machine + var defaultAccount = AccountManager.GetDefaultAccount(); + + // Create a new "base" object + var commitObj = new Base(); + // Base objects are dynamic, so you can assign any properties just like a Dictionary + commitObj["myProp"] = "myPropValue"; + commitObj["myOtherProp"] = new List { "A", "list", "of", "values" }; + + // Send the object to Speckle, get back the commit id + var commitId = Helpers.Send("2d9b814ed6", commitObj, "Upload from my console app", null, 0, defaultAccount, false).Result; + + // To receive the latest commit + var receivedObj = Helpers.Receive("2d9b814ed6", defaultAccount).Result; + Console.WriteLine(receivedObj["myProp"]); + } + } +} diff --git a/CSharpStarter/Readme.md b/CSharpStarter/Readme.md new file mode 100644 index 0000000..e034242 --- /dev/null +++ b/CSharpStarter/Readme.md @@ -0,0 +1,12 @@ +# Using Speckle Core + +``` +dotnet new console -f netcoreapp3.1 +``` + +Add Speckle.Core + +``` +dotnet add package Speckle.Core --version 2.1.22 +``` + diff --git a/PythonStarter/Readme.md b/PythonStarter/Readme.md new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md new file mode 100644 index 0000000..7c0d804 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# AEC Tech Presentation Repo diff --git a/WebStarter/Readme.md b/WebStarter/Readme.md new file mode 100644 index 0000000..e69de29 diff --git a/WebStarter/app.js b/WebStarter/app.js new file mode 100644 index 0000000..442c951 --- /dev/null +++ b/WebStarter/app.js @@ -0,0 +1,7 @@ +console.log("Hello Speckle!") + +// Create the viewer instance +let viewer = new window.Speckle.Viewer({ + container: document.getElementById("viewer"), + showStats: true +}) diff --git a/WebStarter/index.html b/WebStarter/index.html new file mode 100644 index 0000000..d50182c --- /dev/null +++ b/WebStarter/index.html @@ -0,0 +1,20 @@ + + + + + + + + Speckle Web Starter + + + + + +
+
+
+ + + + \ No newline at end of file diff --git a/WebStarter/styles.css b/WebStarter/styles.css new file mode 100644 index 0000000..aa32654 --- /dev/null +++ b/WebStarter/styles.css @@ -0,0 +1,15 @@ +body { + margin: 0; + padding: 0; +} + +#viewerParent { + min-width: 100vw; + min-height: 100vh; +} + +#viewer { + min-width: 100vw; + min-height: 80vh; + border: 1px solid black; +}