Initial boilerplate commit
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
**/bin/
|
||||
**/obj/
|
||||
|
||||
**/.vscode/
|
||||
**/.DS_Store
|
||||
@@ -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>
|
||||
@@ -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"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
```
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
console.log("Hello Speckle!")
|
||||
|
||||
// Create the viewer instance
|
||||
let viewer = new window.Speckle.Viewer({
|
||||
container: document.getElementById("viewer"),
|
||||
showStats: true
|
||||
})
|
||||
@@ -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>
|
||||
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user