Notifications
Clear all

[Closed] exchange data between c# and MaxScript

Hi , i vale a little issue exchanging data from a Csharp dll and maxscript:
I need to pass a lot of values because i can’t write the c# code in maxscript for efficiency issue and because the Garbage Collection of maxscript create some “System exception” when i manage with very big geometry file (>50MB).

 this is a little example, in c# i build a function what read a big geometry file with a lots of mesh inside, and create a class instance. I create a function that return the mesh data as Face, Vertex ,TVerts and Normal array... but the only solution is passing each float value

  using System;
  using System.Collections;
    using System.IO;
    using System.Text;
    using Autodesk.Max;
   public class MaxscriptTest
   {
      public IPoint3 GetPoint(float x, float y, float z)
     		{
     			IPoint3 pt = Autodesk.Max.GlobalInterface.Instance.Point3.Create(x, y, z);
     			return pt;
     		}
   }
(
  	ScriptDir = getFilenamePath (getSourceFileName()) -- must be load at the beginning of script
  	Dll = dotnet.loadAssembly (ScriptDir+"\\mynamespace.dll")
  	Script = Dll.CreateInstance "mynamespace.MaxscriptTest"
  	P = Script.GetPoint 0 0 0
  )	

but don’t return a Point3 value, i need convert in pmxs = point3 P.x P.y P.z

So the same issue when passing a vertex array from maxscript to c#… i must create an array instance, and passing each float value…

I can’t build plugin, my tool must work for all 3dstudio versions so i can compiling a plugin for each release…

I read a lot of tutorial about Max.net… but why a simple problem like passing value is so impossibile ??? Why loading dll if the only parameters that can be passed are primitives ???