Created
November 15, 2020 19:42
-
-
Save andrewheumann/665dbc91b9c199973db16ba61627d0ba to your computer and use it in GitHub Desktop.
Sample Hypar Function - Just Mass
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Elements; | |
using Elements.Geometry; | |
using System.Collections.Generic; | |
namespace StarterFunction | |
{ | |
public static class StarterFunction | |
{ | |
/// <summary> | |
/// My very first hypar function | |
/// </summary> | |
/// <param name="model">The input model.</param> | |
/// <param name="input">The arguments to the execution.</param> | |
/// <returns>A StarterFunctionOutputs instance containing computed results and the model with any new elements.</returns> | |
public static StarterFunctionOutputs Execute(Dictionary<string, Model> inputModels, StarterFunctionInputs input) | |
{ | |
// create an outputs object and populate any output values | |
var output = new StarterFunctionOutputs(input.Width * input.Length * input.Height); | |
// create a rectangle | |
var rectangle = Polygon.Rectangle(input.Width, input.Length); | |
// create a mass from the rectangle | |
var mass = new Mass(rectangle, input.Height); | |
// add the mass to the output model | |
output.Model.AddElement(mass); | |
return output; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment