Hi All,
I am trying to create a custom C# component by I have no luck. Here is my code below. It compiles with no problem but I cannot load it into Dynamo. Any ideas why?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.FSharp.Collections;
using Dynamo;
using Value = Dynamo.FScheme.Value;
using Dynamo.Core;
using Dynamo.Controls;
using Dynamo.Models;
using Dynamo.Revit;
using Dynamo.Utilities;
using Dynamo.UI;
using Dynamo.UI.Prompts;
using Dynamo.ViewModels;
using Dynamo.Nodes;
namespace SMARTDynamo
{
[NodeName(“Value.Compare”)]
[NodeCategory(BuiltinNodeCategories.CORE_SCRIPTING)]
[NodeDescription(“Returns the maximum of two give numbers.”)]
class MyFirstNode : NodeWithOneOutput
{
public MyFirstNode()
{
InPortData.Add(new PortData(“A”, “A number to compare”, typeof(FScheme.Value.Container)));
InPortData.Add(new PortData(“B”, “A number to compare”, typeof(FScheme.Value.Container)));
OutPortData.Add(new PortData(“Max”, “The greater of the two inputs”, typeof(FScheme.Value.Container)));
RegisterAllPorts();
}
public override Value Evaluate(FSharpList<Value> args)
{
double a = (double)((FScheme.Value.Number)args[0]).Item;
double b = (double)((FScheme.Value.Number)args[1]).Item;
double c = Math.Max(a,b);
return FScheme.Value.NewContainer©;
}
}
}
All the best,
-Miguel