Initial boilerplate commit

This commit is contained in:
Alan Rynne
2021-06-30 13:14:48 +02:00
commit e8bcebdda1
10 changed files with 110 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
**/bin/
**/obj/
**/.vscode/
**/.DS_Store
+13
View File
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Speckle.Core" Version="2.1.22" />
<PackageReference Include="Speckle.Objects" Version="2.1.22" />
</ItemGroup>
</Project>
+37
View File
@@ -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<string> { "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"]);
}
}
}
+12
View File
@@ -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
```
View File
+1
View File
@@ -0,0 +1 @@
# AEC Tech Presentation Repo
View File
+7
View File
@@ -0,0 +1,7 @@
console.log("Hello Speckle!")
// Create the viewer instance
let viewer = new window.Speckle.Viewer({
container: document.getElementById("viewer"),
showStats: true
})
+20
View File
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Speckle Web Starter</title>
<script src="https://unpkg.com/@speckle/viewer"></script>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div id="viewerParent">
<div id="viewer"></div>
</div>
<script src="app.js"></script>
</body>
</html>
+15
View File
@@ -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;
}