cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Mathcad dll - vector in vector

ptc-4841445
1-Newbie

Mathcad dll - vector in vector

Hello everyone,

I am trying to create the dll function that takes 2 vector (1D array / column matrix) arguments, and returns vector, but the first vector argument of a function and its return vector have the following structure: first two parameters are scalars, the third one is a 5 element vector. So we have a two different types of parameters in a vector. It is possible in mathcad to have a different types in a matrix, but I have a problem to do this writing my dll. Does anybody know how to implement this in C++? Any hints?

Thanks in advance for help.

7 REPLIES 7
LucMeekes
23-Emerald III
(To:ptc-4841445)

Nested vectors and matrices are not supported in the DLL interface for Mathcad.

There is some information on the (internal) structure of nested matrices, dating back a good many years (e.g. http://communities.ptc.com/message/84308#84308). I've tried myself to write a function that returns a nested matrix, and found that it works only sometimes.

Success.

Luc

Luc, thanks for reply. I supposed there will be problem with that...

Can you please show me your function that returns a nested matrix? Maybe there is some bug in the code, so that is why it works only sometimes? Apart from that, the problem can lay on the mathcad side, as I recognize is as quite buggy software, unfortunately. Nevertheless, I would take a look on this, if you would be so kind.

Piotr

I do not recommend using this technique, as it is not documented and was removed after the MС11. I can show you how to use nested arrays with random data (numbers, arrays, strings). But it works only in MC11.x.

Here's what you can do once using nested arrays:

dllimplicitplot3d.PNG

The archive is a project with dllimpliitplot3d() function, which takes a parameter as nested arrays and returns the result as a nested array. Comments in russian, sorry. If you want to understand how this works, you need to run the project under the debugger.

Thank you Viacheslav. Russian's not a problem for me, I am a Polishman and been in your country 3 times, by the way. The problem is that I use 15 version of MC. I've got an idea how to solve my problem - the nested vector elements will be just succesive elements of the vector(s), and will be then "encapsulated" in separate vector (on the mathcad level). I was going to avoid such a situation, but I have no choice.

If there is anybody from PTC R&D reading this - fellas! do something witha a user dll development because its capabilities are sooo poor, and even developer's reference haven't been updated for many, many years, and is bad documented.

Nice to hear. As for the MС15, User EFI interface will no longer be supported. MC15 is the latest Mathcad version. Mathcad Prime is a different program. So, many people here have forgotten how to make user dlls.

The reason is very simple - Mathcad Prime uses managed .Net space but user efi works in unmanaged space.

Sometimes we're remind here how it was - with good old Mathcad.

For me Mathcad Prime is a trash, even apart from the user efi issues. I had a short adventure with it, and don't want to have anything to do with "this thing". Wrong way change direction. It even looks worse (candy style)! In my opinion PTC changed the target from origin (engineers, higher education and PhD students, scientists, professionals) to kids and secondary school students. Yeah, that sounds stupid, but it fits to the actual profile of this software. They try to do Mathcad more idiot-resist, but it lost its "identity".

efi.data error messages in MC15 may remind of embedded efi problems though?

Top Tags