Hello, i am studying master program at mechanical engineering. I am trying plot a circle using 3 points of a triangle. Circle must be plot inside triangle. How can i do?
plotting a circle with triangle
Nested if Statements
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)
Automation changes between 13 and 14?
Mathcad.NumericValue v = new Mathcad.NumericValue();
I get the following exception:
Unable to cast object of type 'Automation.Wrappers.NumericValue' to type 'Mathcad.NumericValueClass'.
Has anyone had a similar problem? Basically the code I used with V13 does not seem to work with V14 (yes, I did update my references to point to the new version of the interop.mathcad.dll file).
Any ideas?
Win32::OLE bridging Perl Thread Issues
Dim mathcad, worksheets, sheet
Set mathcad = CreateObject("Mathcad.Application")
set worksheets = mathcad.Worksheets
Set sheet = worksheets.Open("C:\vbscript\testM12.xmcd")
sheet.setValue "x",50
sheet.setValue "y",60
sheet.setValue "z",70
sheet.Recalculate
MsgBox(sheet.getValue("output1"))
MsgBox(sheet.getValue("output2"))
that I translated to perl using the Win32::OLE module. It is as follows:
#!/usr/ym/util/perl
use Win32::OLE;
#Perl "C:/documents and settings/aaron.verellen/desktop/trial2.pl"
#Win32::OLE->Initialize(COINIT_OLEINITIALIZE);
Win32::OLE->Option(Warn => 2);
#use existing instance if mathcad is already running
eval {$MC = Win32::OLE->GetActiveObject('Mathcad.Application')};
die "Mathcad not installed" if $@;
unless (defined $MC)
{
$MC = Win32::OLE->new('Mathcad.Application', sub{$_[0]->Quit;})
or die "Unable to start Mathcad";
}
#Open specific worksheet
my $filePath = 'C:\Documents and Settings\aaron.verellen\Desktop\testM12.xmcd';
my $WS = $MC->Worksheets;
my $S = $WS->Open($filePath);
#Set values on the worksheet
$S->setValue('x',50);
$S->setValue('y',60);
$S->setValue('z',70);
$S->Recalculate;
my $test = $S->getValue(\'x');
print "test = $test\n";
my $answer1 = $S->getValue('output1');
my $answer2 = $S->getValue('output2');
print "($answer1,$answer2)\n";
When I run the code I get the following error message:
C:\>Perl "C:/documents and settings/aaron.verellen/desktop/trial2.pl"
Win32::OLE(0.1709) error 0xc00000fd
in METHOD/PROPERTYGET "getValue" at C:/documents and settings/aaron.verellen
/desktop/trial2.pl line 31
test =
When I take this before perl experts they tell me that error 0xc00000fd appears to mean stack overflow...something to do with threads and they point me here. I was hoping that someone here can give me a little help in getting the getvalue methode working so I can retrieve values from the mathcad worksheet. Everything else appears to be working properly with the exception of this error.
Thank you in advace for any help you are able to give,
Aaron
Nested if Statements
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)
Solving Laplace's Equation
Mathcad Vs. Mathematica
It would be great if you would.
Thanks
Javier.
COMPLEX PROBLEM TO BE SOLVED IN MATHCAD - GUIDANCE NEEDED
Hello Everyone,
I have a complex problem to get solved in the best way of approach.
I have attached the worksheet with my requirement.
I'm using MC version 15.0
Kindly help me.
How to use controls in mathcad (textbox,radio buttons,push buttons)
Dear all,
How do we use these controls in mathcad.
Can anyone post some samples. Just I wanted to understand the approach with an example.
I have seen these controls using in excel, just thinking about the approach to use in MC
Nested if Statements
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)
Mathcad Automation API
In the Mathcad 15 vs Prime comparison chart (http://www.ptc.com/WCMS/files/121440/en/6017_Mathcad_Comparison_TS_EN.PDF), I see that "Use OLE Automation and Visual Basic® to call Mathcad" is not available in Mathcad Prime 1.0. My utilization of Mathcad relies heavily on my ability to import values from Mathcad into VBA. Does anyone know if/when this will be available with Prime?
Thanks.
Again else If statements
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)
Again, if someone could give me a hand with this (I'm going crazy) I would appreciate.
Thx in advance.
Area Collapse/Expand
I have MC13 and I'm writing some applications using the mathcad controls.
Is there any way that I can write a script inside a component (e.g. radio button, push button, etc) to expand and collapse areas inside the same spreadsheet?
Thanks in advance,
David
Colour between curves
Please could someone show how to colour beteeen two curves.
see attached.
thanks
Jason
Foreign Exchange Currencies in MathCad
I am interested in finding a way to process foreign exchange rates in MathCad. Does anyone know of a workaround or add-in that will allow me to declare the value of one currency in terms of another, and then use that value to complete my calculations?
Shift Register Instead of For loop
Hiya,
Is it possible that I could use shift registers instead of for loop in mathcad.
Thanks.
working with vectors in a program
Hi everyone, I'm having lots of issues with one program I'm doing, and I would like to ask if you can help me with one in particular.
I'm trying to pick up a number from a vector compare it with some value and then do an iteration, but for some reason Mathcad doesn't let me pick up the number from the vector.
I'm trying to do:
but it seems that I cannot use this kind of statement in an iteration.
Thx in advance.
PS: I'm Spanish so excuse me if my english it's a little bit rough
Simple program - wrong return value
This is a problem I stumbled upon writing a more complex routine (
) and was able to cut down to the attached simple programs.Can anybody explain whats wrong with Test2()?
Why is the else branch ("otherwise") not evaluated when the first "if" is triggered??
Inserting that dummy line as in Test1() "solves" that problem, but whats the reason for this?
selection of items in a Marix
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
creating a program for multiple-application trapezoidal rule
I have to create a program using the multiple-application trapezoidal rule. I'm not sure what else I need to add into the program. It keeps saying my f(x) variable is undefined. I've tried a few things and nothing is working. Thanks for any/all help.