Skip to main content

14 replies

1-Visitor
June 26, 2014

Updated.

Now 3 test projects available: c#, vb.net and c++/cli. All based on .net 2.0.

13-Aquamarine
July 7, 2024

Mathcad Prime 10.0 x64 also supported.

 

netefi.png

1-Visitor
June 27, 2014

Updated.

- echo functions added;

- small changes.

Simple examples are attached (pdf files).

25-Diamond I
June 27, 2014

Great work!

Thanks for sharing!

1-Visitor
June 27, 2014

Thanks.

If someone will write JSON codec as a program, it will allow to exchange of data (between Mathcad and dll) in any format, using strings (nested arrays, for example.).

1-Visitor
June 27, 2014

Updated.

- error handling added (only one function in the assembly may contain a static field Errors - array of strings).

For example:

using System;

public partial class cserror {

public static String[] Errors = {

"cserror 1",

"cserror 2",

"cserror 3",

"cserror 4"

};

}

How to use:

using System;

using NetEFI;

public partial class cserror: IFunction {

public FunctionInfo Info {

get {

return new FunctionInfo( "cserror", "n", "return error string",

typeof( String ), new[] { typeof( TComplex ) } );

}

}

public FunctionInfo GetFunctionInfo( string lang ) { return Info; }

public bool NumericEvaluation( object[] args, out object result ) {

throw new EFIException( ( int ) ( ( TComplex ) args[0] ).Real, 1 );

}

}

EFIException( ErrNum, ArgNum) - like in MAKELRESULT().

1-Visitor
June 27, 2014

Sorry for my ignorance here but I am a little confused about what you are doing. Do you mind claying exactly what you are doing?

1-Visitor
June 27, 2014

Not sure understand correctly.

In this discussion we will collect, I hope, all the issues related to the design of user libraries based on .Net languages.

Feel free to asking questions.

1-Visitor
June 27, 2014

Sorry I should have read up on EFI before posting. Is this a way of developing user defined functions with Mathcad I take it?

1-Visitor
July 2, 2014

Updated (github).

Now you can use context:

public bool NumericEvaluation( object[] args, out object result, ref Context context ) {

//while ( !context.IsUserInterrupted ) { }

if ( context.IsDefined( "vbecho" ) ) {

context[ "vbecho" ].NumericEvaluation( args, out result, ref context );

} else {

result = Evaluate( ( string ) args[0] );

}

return true;

}

public string Evaluate( string text ) {

return text;

}

13-Aquamarine
January 22, 2021

Updated (github).


How it works (rus): Внедрение кода с пользой

Tested for MC15 M050 x32 and MC Prime 6.0 x64. Now you can use .net (c#, vb.net, c++/cli) user functions in x64 Mathcad Prime.

 

[22-01-2021]

- 64-bit support added.

 

[21-01-2021]
- TComplex changed to .Net Complex from System.Numerics;
- refactored.

 

[19-01-2021]
- added support utf-8 for result string;
- added example project "capture".

 

[18-01-2021]
- only for 32-bit systems;
- mc15 m050 tested;
- .net 4.0 supported;
- examples for vs2019.

netefi-x32.png

netefi-x64.png

13-Aquamarine
January 23, 2021

Now we can increase the speed of calculations. In this example in 5 times. Part of the function is implemented in the plugin.

 

2021-01-23_22-08-58.png  

2021-01-24_02-32-39.png

 

13-Aquamarine
July 11, 2021

MC Prime 7.0 x64 also supported.

13-Aquamarine
March 31, 2022

Mathcad Prime 8.0 x64 also supported.

 

NetEFI in MP8.jpg

 

photo_2022-03-30_23-50-25.jpg

13-Aquamarine
July 7, 2024

Mathcad Prime 10.0 x64 also supported.

 

cstools.png 

CustomFunctions.png