Mesh from C# node not visualised

HI everybody!
I wrote simple custom package in Visual Studio which return simple mesh to Dynamo system. I can use this custom node in Dynamo, but mesh from node not visualised. I am sure that mesh is correct, because i can split mesh on points and index groups which can be joined back to mesh and its visualised!!!. I think problem is that my custom node on C# not correct return Mesh to Dynamo or Dynamo not understand that to do with node result.

Can some body discuss or clarify how to make it work correctly?

Code bellow:

///


/// Sample NodeModel
/// In order to execute AstFactory.BuildFunctionCall
/// the methods have to be in a separate assembly and be loaded by Dynamo separately
/// File pkg.json defines which dll are loaded
///

[NodeName(“HelloNodeModel”)]
[NodeDescription(“Example Node Model, return simple mesh”)]
[NodeCategory(“HelloDynamo”)]
[InPortNames(“A”, “B”)]
[InPortTypes(“double”, “double”)]
[InPortDescriptions(“Number A”, “Numnber B”)]
[OutPortNames(“C”)]
[OutPortTypes(“Autodesk.DesignScript.Geometry.Mesh”)]
[OutPortDescriptions(“Mesh of object”)]
[IsDesignScriptCompatible]
public class HelloNodeModel : NodeModel
{
public HelloNodeModel()
{
RegisterAllPorts();
}

public override IEnumerable BuildOutputAst(List inputAstNodes)
{
if (!HasConnectedInput(0) || !HasConnectedInput(1))
{

return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) };

}

var functionCall =
AstFactory.BuildFunctionCall(
new Func<double, double, Mesh>(SampleFunctions.MultiplyTwoNumbers),
new List { inputAstNodes[0], inputAstNodes[1] });

return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), functionCall) };
}
}

what does your code look like inside your what I am assuming is a modified MultiplyTwoNumbers function?

try returning a solid instead or a curve and check if that visualizes correctly as well.

Thank you for answers. I will try!!
I am not included the code of MultiplyTwoNumbers function because it surprising. The function using Navisworks automation API, start Naviswork application instance and call special plugin for Navisworks which start WEB API service. WEB API able find object in Navisworks currently open document and tessellate them to triangles. Points of triangles returned to the Dynamo node. In the Dynamo node Mesh object is built by points.

Code bellow:

public static Mesh MultiplyTwoNumbers(double a, double b)
{

    NavisworksApplication navisworksApplication;


    // Start Navisworks        
    navisworksApplication = NavisworksApplication.TryGetRunningInstance();

    // This code is written by an application developer.
    // Create a channel factory.
    BasicHttpBinding myBinding = new BasicHttpBinding();
    myBinding.MaxReceivedMessageSize = 500000000;
    EndpointAddress myEndpoint = new EndpointAddress("http://localhost:8080/hello");

    if (navisworksApplication != null)
    {
        //navisworksApplication.OpenFile(@"e:\efimsergeev\anton\viatechnik__navisworks\models\gatehouse.nwd");
        HelloWorldService.HelloWorldServiceClient client = new HelloWorldService.HelloWorldServiceClient(myBinding, myEndpoint);
        var val = client.SayHello("hi");
        HelloWorldService.Point[] points = client.TesselateObject("some param");

        List<Point> adPoints = new List<Point>();
        List<IndexGroup> adgroups = new List<IndexGroup>();
        uint id = 0;
        foreach(HelloWorldService.Point pts in points)
        {
            Point newPoint = Point.ByCoordinates(pts.X, pts.Y, pts.Z);                
            adPoints.Add(newPoint);
            
            id++;
            if( id % 3 == 0)
            {
                IndexGroup newGpoup = IndexGroup.ByIndices(id - 3, id - 2, id - 1);
                adgroups.Add(newGpoup);
            }
        }

        //create mesh
        Mesh mesh = Mesh.ByPointsFaceIndices(adPoints, adgroups);

        return mesh;
    }
    else
    {
        navisworksApplication = new NavisworksApplication();
        // Execute command on our message receiver
        int retval = navisworksApplication.ExecuteAddInPlugin(pluginIDPrefix + "." + pluginGUID, "42");
        HelloWorldService.HelloWorldServiceClient client = new HelloWorldService.HelloWorldServiceClient();
        var val = client.SayHello("hi");
        
      .....
    }