Quantcast
Channel: PTC Community : Popular Discussions - Programming & Extending Mathcad
Viewing all 2429 articles
Browse latest View live

Script Editor

$
0
0
Hi all!

Is it possible to use microsoft excel's VB script editor to debug MCAD scripts?

Thanks,

Gary

Script to create dropdown menu in Mathcad 14, that imports data from excel file

$
0
0

I need to find a way to create a drop-down menu in Mathcad that grabs material properties directly from an Excel file, and plugs them into the mathcad workspace. Could someone please point me in the right direction so that I can try to figure this out. I have attached a picture of what this dropdown menu might look like in Mathcad. The other attachment is a sample Excel file that  would contain the material properties. Thank you, any help would be greatly appreciated.

Integration between MathCad and Inventor

$
0
0
Is there any functions in MathCad or Autodesk Inventor that can integrate them with each other?
I expect that Inventor can automatically generate the drawings with the dimensions relevant to the calculation result in MathCAD.

data file input - programmed file name

$
0
0
I use the built-in data file input component to read excel, text, csv and other standard format files. The component lets you browse for the file, which can be quite convenient.

Other times, I would like to use a filename that has been derived or constructed through Matchad, and exists as a variable with a string value. The file read functions READPRN, READBIN, etc. allow the use of a mathcad variable file name.

Is there a way to combine the features of these two types of calls? I want to use the data file input component that handles the various file formats mentioned above, but I want to be able to pass the filename & path as a mathcad variable.

The data file input component doesn't allow access to its script (probably keeps me out of trouble!), so I can't try to modifiy it and pass an input variable.

Lou

Convert radians to degrees Mathcad Prime 2.0

$
0
0

I am havining trouble getting degrees out of my trig calculations.  I am calculating sin(12.414) which in mathcad comes out to -0.152.  On my calculator (set on deg mode) I get the answer of 0.2149.  I am trying to get mathcad to spit out the 0.2149 number.  Can any one help me with this?  Thanks!

Mathcad 15 VB 6.0 automation error.

$
0
0

Hi,

 

I am using Mathcad 13 - VB 6.0 OLE  automation for calculations.

 

Everything was working fine till now. We are planning an upgrade to MathCAD 15.

 

When I tested the same VB application on MathCAD 15 version am receiving the following error. See the attached screenshot.

 

System Config: Windows server 2008 standard 64 bit, VB 6.0, Microsoft Office 2010.

 

Please let me know how can I resolve this issue.

 

Thanks,

 

Ram

Mathcad API and c#

$
0
0
Hello,

I posted this on the ptc mathcad forums before I found this place. I figured this is the right place though.

I am investigating connecting my companys Mathcad worksheets together with our Cad software. The cad part is already in place but when I started translating an example found in your helpfiles to c# regarding checking out setting/getting values from a worksheet i ran into some problems.

I added the source(below) for the test i am running. If anyone have any hints to as what I am doing wrong here or have a C# example for the MathCad API to share that would be very much appriciated.


Best regards,

Tobias Svenberg

---------- MathCad worksheet
(Trying to set a and retrieve b)

a:=
b:=a+5

---------- C# Source code
public partial class mathcadTest : Form
{

Mathcad.Application mc = new Mathcad.Application();
Mathcad.Worksheets wk;
Mathcad.Worksheet ws = new Mathcad.Worksheet();

public mathcadTest()
{
InitializeComponent();

}

private void doMathCadTest()
{
wk = mc.Worksheets;
ws = wk.Open(@"c:\temp\mathcadtest1.xmcd");
ws.SetValue("a", "10");
ws.Recalculate();
try
{
string b = ws.GetValue("b") as string;
MessageBox.Show(b);
}
catch (Exception e)
{
MessageBox.Show(e.ToString());
}

ws.Close(Mathcad.MCSaveOption.mcDiscardChanges);
System.Runtime.InteropServices.Marshal.ReleaseComObject(wk);
System.Runtime.InteropServices.Marshal.ReleaseComObject(ws);
System.Runtime.InteropServices.Marshal.ReleaseComObject(mc);
}

private void button1_Click(object sender, EventArgs e)
{
doMathCadTest();
}
}

Call C# Object from MathCad?

$
0
0
Hi,

I am working with MathCad 13 and Visual Studio 2005. I am trying to create a C# object, make it into a COM callable object, and then use that object from within MathCad.

I have played with COM objects created in VB6 and have been able to use them with in VB Script within MathCad.

For example, this code works as part of a button object in a MathCad worksheet.

Sub PushBtnEvent_Exec(Inputs,Outputs)
Dim b
MsgBox "Exec"
Set b = GetObject( "", "VerySimpObject.MyClass" )
MsgBox "after create object " & b.Name
End Sub

In the above case, 'VerySimpObject' is a VB6 ActiveX DLL. When it is executed, there are two MsgBoxes as expected.

When I try to do this with a simple C# object, I get an error on the GetObject call. The first MsgBox displays as expected, but then an error is reported:

(null)
Line:18 Error:0
(null)

Is it possible to invoke a .Net object from MathCad 13?

Thanks,

Bob


Mathcad Vs. Mathematica

$
0
0
Jim you mentioned that you use Mathematica as well as Mathcad. Can you give us (me) a comparison between the two applications. Advantages and disadvantages.

It would be great if you would.

Thanks
Javier.

selection of items in a Marix

$
0
0

Hello everybody,

 

I need some help to select sevral lign in a matrix using a logical test and then create a vector which wwould summarize all selected items.

 

To be more accurate, my problem is to select the right "spring" cosidering given deflexion and maximum reaction load within this loading configuration. I already creat a fonction which calculat the reaction load for a given deflexion and spring model ( equ_paulstra_reactionload("matrix of the approximated polynomial coeficient which give reaction load in function of the deflexion","deflexion","ligne of the considered model" ). Then I would create a fonction which test each spring and put them in a vector using there reference.

 

I join my work done so far.

 

Thanks a lot for your elp,

 

regards,

 

Mathieu STAUCH

instead of the matrix

$
0
0

Hi all.

I is prolem. Please see picture.

File I attacment.

thanks.

2012-10-12_1106.png

Again else If statements

$
0
0

Hi everyone, I don't know what's happening to me, but when I think I know how Mathcad works, I'm not able to do a simple thing.

 

Mi problem today it's that I'm trying to do an "else if" statement but again, for some reason I cannot figure out how to program it. I've searched through the forum but I don't know how to fill the part that is missing (see image)

 

Clipboard06.jpg

 

Again, if someone could give me a hand with this (I'm going crazy) I would appreciate.

 

Thx in advance.

Mathcad 15 VB 6.0 automation error.

$
0
0

Hi,

 

I am using Mathcad 13 - VB 6.0 OLE  automation for calculations.

 

Everything was working fine till now. We are planning an upgrade to MathCAD 15.

 

When I tested the same VB application on MathCAD 15 version am receiving the following error. See the attached screenshot.

 

System Config: Windows server 2008 standard 64 bit, VB 6.0, Microsoft Office 2010.

 

Please let me know how can I resolve this issue.

 

Thanks,

 

Ram

Need help w/ 'unitless'? in matrix calculation

$
0
0
I am frequently stopped in Mathcad14 by, for example) the message: =f(Unitless, [Unitless],Unitless, [Unitless]) --> [Unitless], which appears in the attached file 'Unitless_pgm.xmcd'. None of my terms have units or intend to use them.
The attached program is a test of steps trying to fill the first column of a 7x3 array.

<0 'negative values are not wanted'
if k=0 'should capture the first value of t'
if phi(m,0)<=t 'skips pre-used values'
then phi(k,0) <-- t fills the rest of the column
(I had hoped, but can't get the program to run)

The t <-- root(()) line works fine.

Need help urgently, a lot of hours have been wasted on this one!
ntelleck

Nested if Statements

$
0
0

I need to do some nested if statements for conditional programming and I cannot figure out for the life of me how to nest if-statements using the programming toolbar.  I am in Matcad 14 and the "add line" button just adds if-else if statements, I need to nest.  All the "add line" option does is just add another line on the same logic level.  Is there a difference between if and conditional if?

 

I posted a flowchart of the basic program logic. (Ignore the red lines, that is just my spell checker)

 

flowchart.png


How to iterate a solution in Mathcad

$
0
0
Hi.

I want to write these equations to iterate to get the value of "T".

T(i) = T0 + dsc/1.005
for i = 1:10000
T(i+1) = T(i) + s(T2(i),T0,0)*T(i)/cp(T(i),0)
if abs(T(i)-T(i+1)) < 0.0001
T = T(i)
break
end
end

I wrote this code in MatLab like that I want to convert this into MathCAD.

Please help me.

Ali

Solve Equation

$
0
0

I am working on the JONSWAP wave spectra analysis in-line with DNV-RP-F109 and having trouble soling the equations in the attached worksheet.

 

The standard indicates that the wave number can be established by iteration from the transcendental equation, but I can’t for the life of me work out how to do it.

 

Mike

How to solve an equation with multiple solutions?

$
0
0

I've a problem to solve such equations, one unknown variable, but infinite solutions, it seems mathcad only return the first one, anyone can confirm this ? And how to handle these equations in MatchCAD?

 

Thanks.

Mathcad 15 VB 6.0 automation error.

$
0
0

Hi,

 

I am using Mathcad 13 - VB 6.0 OLE  automation for calculations.

 

Everything was working fine till now. We are planning an upgrade to MathCAD 15.

 

When I tested the same VB application on MathCAD 15 version am receiving the following error. See the attached screenshot.

 

System Config: Windows server 2008 standard 64 bit, VB 6.0, Microsoft Office 2010.

 

Please let me know how can I resolve this issue.

 

Thanks,

 

Ram

Extracting Data from MathCAD using VB.net

$
0
0

Hi,

 

  1. Trying to extract/ pass data to MathCAD 15.0 using Vb.Net (VB 2010- Dotnet Framwork 4.0).
  2. We are trying to pass 2 values (“A”, & “B”) from Vb.Net to MathCAD and then performing a simple calculation of (C=A+B) in MathCAD and extracting the value of “C” from MathCAD back to Vb.Net.
  3. The project was developed as per the documentation available; but there seems to be minor issue in reading data from MathCAD.
  4. Sample project and test MathCAD attached.

 

We will be thankful if someone can respond to our query.

 

 

Thanks

Viewing all 2429 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>