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
public override void AddedToDocument(GH_Document document) | |
{ | |
//when the grasshopper component gets added to the document, i init nancy | |
var uri = new Uri($"{_url}:{_port}/"); | |
var configuration = new HostConfiguration() | |
{ | |
UrlReservations = new UrlReservations() { CreateAutomatically = true } | |
}; |
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
// The usual setup | |
protected override void SolveInstance(IGH_DataAccess DA) | |
{ | |
// More standard setup | |
int index = this.Params.IndexOfInputParam("Inputs"); | |
List<IGH_Param> L = this.Params.Input[index].Sources.ToList(); | |
doc = Grasshopper.Instances.ActiveCanvas.Document; | |
if (runCount < MAX_RUN) // MAX_RUN = 20, runCount starts with 0 | |
{ |
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 System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using Rhino; | |
using Rhino.Geometry; | |
using Grasshopper; | |
using Grasshopper.Kernel; | |
using Grasshopper.Kernel.Data; |
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
const paramData = [ | |
{ | |
a: 1, | |
b: 2, | |
c: 3 | |
}, | |
{ | |
a: 2, | |
c: 4 | |
}, |
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
{"op":"NEW","alts":{"params":{"radius1":18,"segments":12,"storeys":7},"geometry":"1ac0aa1d-3429-4dea-8326-bf37076a7401.json","image":"iVBORw0KGgoAAAANSUhEUgAAAyQAAAIzCAIAAAB+zErEAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAFiUAABYlAUlSJPAAADojSURBVHhe7d1LjxzXmeD92sxutgOtZterALzxqhcBGD1owIkYQLv8CIkeYF5f2pZtWSlZskzdU5RE3SiSut9M+SJLvrRnxu1pu/1eOePBbPQR+nO8T8XDOn0UmZUsknVK3RW/Hw4IuRhxMjILZf5x4mTWwT8BANCM2AIAaEhsAQA0JLYAABoSWwAADYktAICGxBYAQENiCwCgIbEFANCQ2AIAaEhsAQA0JLYAABoSWwAADYktAICGxBYAQENiCwCgIbEFANCQ2AIAaEhsAQA0JLYAABoSWwAADYktAICGxBYAQENiCwCgIbEFANCQ2AIAaEhsAQA0JLYAABoSWwAADYktAICGxBYAQENiCwCgIbEFANCQ2AIAaEhsAQA0JLYAABoSWwAADYktAICGxBYAQENiCwCgIbEFANCQ2AIAaEhsAQA0JLYAABoSWwAADYktAICGxBYAQENiCwCgIbEFANCQ2AIAaEhsAQA0JLYAABoSWwAADYktAICGxBYAQENiCwCgIbEFANCQ2AIAaEhsAQA0JLYAABoSWwAADYktAICGxBYAQENiCwCgIbEFANCQ2AIAaEhsAQA0JLYAABoSWwAADYktAICGxBYAQENiCwCgIbEFANCQ2AIAaEhsAQA0JLYAABoSWwAADYktAICGxBYAQENiCwCgIbEFANCQ2AIAaEhsAQA0JLYAABoSWwAADYktAICGxBYAQENiCwCgIbEFANCQ2AIAaEhsAQA0JLYAABoSWwAADYktAICGxBYAQENiCw |