Quantcast
Channel: PTC Community : All Content - Programming & Extending Mathcad
Viewing all 680 articles
Browse latest View live

Overwrite variabel from reference file?

$
0
0

Hello

Im writing my master thesis and the idea is to have a reference file for all functions

sadly if i do not write out the variabels before the function, i need to "call them" in the function name

ending up with a function with 20 variables such as

 

func(a,b,c,d,e,f,g, etc etc) and the function will not fit in a printable area

My idea is therefor

 

to put all values equal to 0 in the reference file and then rewrite the values when the reference file is used

sadly i fail to do so since the values from the reference files are used even when I rewrite them.

 

The idea is that i want to do something like this, and in the "regular file" get the value 2 instead of 0

question.png

I know this is a bad function but its used only to demonstrate my problem. Is there any way to rewrite the values from the reference file?

Or do i really have to end up with a function in reference file as "func(a,b)=..."

 

Appreciate your help since this is the last step left in my master thesis and all the programming is done properly

Im using Mathcad 15


Is tehre any windchill java pdf is available for how to use the windchill java api?Can u please help me out ?

$
0
0

Hi Friends,

Is tehre any windchill java  pdf is available for how to use the windchill java api?Can u please help me out ?

 

 

Regards,

Sandeep

Ansys and Mathcad

$
0
0
Does anyone have some direct experience of getting Mathcad running under Ansys workbench as per the plugin that was made last year? I am really struggling to get Mathcad to open under workbench on our 64 bit machines and could do with a little help :)

Many thanks,

Mike

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.

Data syncronize by using component (mathcad 15)

$
0
0

Hello there,

 

Above all, I am the very biginner for Mathcad as well as programming. So please forgive me if my questions would be so basic or stupid. (i am trying. ;;;)

 

Since I have several data to be selected by users, I've decided to use mathcad 15 than prime so that I can make full use of components.

I am making a calculation worksheet with a number of back data and I want to know how to syncronize data, like. (refer to the attached also)

 

example.jpg

 

I have 4 materials for moment having information of size 1&2, parameter 1&2.

Some information is duplicated, some is not.

Under this situation, I want to program like.. 

 

 

when I select material 1 in the 1st list box (or ribbon which is more favorable), the second list box (or so) shows only the applicable information.

the third, forth and fifth.. accordingly.

Any advice on this?

 

 

By the way, I read a forum explaining about list box which was greatly helpful to me and I could hardly understand a part.

I've brought a screen shot below and I want to know what "+3" or "+1" of steel +3, property+1 does exactly mean or work.

 

 

mathcad.png

 

 

 

Thanks so much in advance.

 

S

Click Button - Export values on click or similar (help wanted)

$
0
0

Hi im writing my master thesis, and im almost done, as a last step i want my values to be exported to excel, and i know how to do this BUT.

 

My problem is that i want to repeat the calculation with different parametars, and after that upon the users will, the values will be exported.

In my case, i have done a automatic export of the values upon every recalculation and i want a button of some type that does this when clicked

 

The task: One button click to export all the matrixes.

Ofc the script will be later integrated into my orginal script and Matrix A to E will be different and present different load-cases and stages.

 

Also if you cant help me, you might want to take a look into the strings I have created that first calculates how many rows in excel that have been used and print the data after that row, so you can collect samples for different input-data, into same file without having to change the write function manually.

 

Im also aware that i could do a for loop to make the script shorter, i will do later. Im asking about the button
I have checked scripts recommended for using buttons to export data to txt. but they didnt work in mathcad 15.

 

If you can, i want the button to be double clicked to activate it.

Mathcad Integration Options

$
0
0

Hello everyone!

 

I am looking for any documentation about the Mathcad integration options. I read that Mathcad can be integrated with CREO and Excel. So, I would like to know if there is any API that allows me to integrate with Java or any another programming language (C, C++, etc.).

 

Please, if someone have anything about it, is it possible to share with me?

 

Thanks a lot for any suggestion.

 

With best regards,

 

Marcio Pereira Garcia

Solve Block

$
0
0

please help to solve the problem.

 

for each TK i need solution.

 

for individual Tk, over range of n, i want minimum value.

 

Thanks in advance.

 

Regards

Prabhu


Opening All Files of one type (extension)

$
0
0
Hey,
I have dozens of .prn files that I've created over the years to store data for different parts. I'm looking to create a short MathCAD program that looks for all files of that type, and creates a listbox of the filenames (which are the part names). When i click on one, a variable would then be assigned the matrix data contained within the chosen file. How would I go about doing this?
Thanks,
Jim

i am getting an error as this variable is undefined.

$
0
0

In the following attached file, I have to plot a(t) vs t for different values of v like v=-1,-5,1,5.

 

i am getting an error as this variable is undefined. how to overcome it.

Including units with the polyfit function

$
0
0

Hello all,

 

I am a fairly new user of Mathcad.  I have a question about utilizing units with the polyfit function.  I have experimental data relating temperature pressure and density.  I wrote a program which needs to look up the density as a function of pressure and temperature.  The original data was in excel, it had several curves for a few temperatures as a function of pressure.The data was very linear and the curves were fairly parallel, so i took the linear regression curves from excel and brought them into mathcad.  I then created a program which allowed me to choose a temperature, it would then choose the two curves which the chosen temperature was between and linearly interpolated between the two points.  I got this program to work with units and is the top portion of the attached file. 

 

I thought there must be a better way, so I decided to try the polyfit function.  I imported the test data and utilized the polyfit function to "fill in" the holes in my data and create a polynomial to describe the surface.  I could not get the polyfit function to work with units.  The polyfit is a much more elegant solution.  Both approaches give very close results but I was wondering if anyone else was having this same type of problem?  

 

The reason I need the units to work out is because I reference this calculation in a program.  I apologize but I can not attach the program. 

 

Thanks in advance for any help/ insight. 

Missing OLE Components

$
0
0

Hello,

after deinstalling a parallel Mathcad 14 installation and registering Mathcad to Net, the converter into Prime 2.0 works but all the OLE components have gone. What are the best options I have to be productive again with both Mathcad 15 and Prime 2.0.

PS: I already have re-installed Mathcad 15 without any changes at all.

PSS: I did find some hints towards using regall.bat, but this relates to Mathcad 8, what is the procedure with Mathcad 15

many thanks

best regards

How to make an Excel file live within a Mathcad file

$
0
0

I have imported an Excel file into Mathcad. I want to be able to change values in Excel and then those same values automatically update within Mathcad. I know you can do this with scripting, but I am not very good at writing code. I have attached the files to the discussion. Any help would be greatly appreciated. 

how to control the position of a view in drw via vb API

$
0
0

hi all,

    i created a part(like a stike) and its drawing with a broken view in it.

   

   when i change the length of the part, the position of the broken view also changed

 

   could i use VB API to control the position of views in drawing? like get the position of views and set a new value to put it?

MATHCAD API: Limit on size of matrix when assigning values

$
0
0

Hello there.

 

I am currnelty explorign the use of the mathcad API for generating a matrix of data from another application.

 

I am using VS2010 Professional and VB.NET. I am using the mathCAD  API for doing this. I am using MathCAD V14.0.2.5

 

It appears that there is a limit on the size of the matrix one can create through using the setelement mehtod of the MatrixValue class.

 

My original matrix was of size 6800 rows x 21 cols. When i try and view this matrix or assign this matrix to a new variable MathCAD shows no vlaue for this matrix. Teh matrix is composed of strings - i ahve to use strings as the data is of a variant/object type i.e. strings/doubles/integers. It seemed to crash when I got ro row 480. For rows less than this i was able to view the matrix in mathcad and assign the matrix to a another user defined valriable as well as extract elements for given indices.

 

As a test I simply ran a loop for a matrix of 480 rows x 18 columns and assigned an integer value of 1 for every elment. In this instance I was able to get mathcad to read the matrix; hwn trying to display it gave the following:

 

POINTSMatrix:=BigMatrix{480x19}

 

If I increase the range to 800x19 I cannot get any value for the matrix. If I use 600x19 it still works

 

Is there a limit on teh maximum size of a matrix that can be assigned using the SetElement method? IS there a better more efficient way fo assigning data to a very large matrix in mathcad using its API? I want to use the Automation API and not manually do this using table.s

 

My code for this is given below, I am using ealry bound code, hence Option Explicit = true, and using Ctype statements:

 

 

 

Dim mcdObject AsNewObject

Dim mcdPointsMatrix As Mathcad.MatrixValue

 

Dim mcdMatrixNew As Mathcad.MatrixValue

 

 

 

 

mcdMatrixNew = CType(Interaction.CreateObject("Mathcad.MatrixValue"), Mathcad.MatrixValue)

 

Try
mcdPointsMatrix = CType(mcdWorkSheet.GetValue("Points"), Mathcad.MatrixValue)
bMatrixExists = True
Catch ex As Exception

bMatrixExists = False

end Try

For i As Integer = 600 - 1 To 0 Step -1
For j As Integer = 18 To 0 Step -1
  If bMatrixExists = False Then
       mcdMatrixNew.SetElement(i, j, 1)
  Else
       mcdPointsMatrix.SetElement(i, j, 1)                   
  End If
Next
Next

If bMatrixExists = False Then
mcdWorkSheet.SetValue("Points", mcdMatrixNew)
Else
mcdWorkSheet.SetValue("Points", mcdPointsMatrix)     
End If

    

 

 

 

 

 

 

 


Using Minimize in Program Loop

$
0
0
I am analysing a system defined by a set of parameters, and I need to analyse it for an array of these parameters.

I want to use Minimize to find an array of minimum values of a function defined by the array of parameters. I also want to use the result found on one set of parameters as an initial guess for the next use of Minimize on the next set.

My original worksheet is too long to post (and to calculate), but I have attached an 11.2a sheet that I think shows the essence of what I want to do. If it's unclear, please say so.

Please don't worry about the details of the problem given here: it's a madeup example that might not work all the way through. It's the principle of how to do it that I'm after.

I'd be grateful for any assistance.

Jon

Greyed out area, and moving an image

$
0
0

Hello,

 

i have two questions:

 

1. why is the area in the attached mathcad sheet is grayed out?

 

2. i am trying to move the image on page 1 down because it is covering part of the calculation, but i cant seem to have any control to move that region.

 

3. this is a general question, when i print  mathcad sheets , some times  half of a table shows uo one page and the other half on the next page.  i try to shift the table  so it is below or above the dotted line  for a new page , but some how mathcad shifts it  again. is there a better way to have a better control over printing ?

 

Thanks!

Help me to program a flow chart please!

Drop down list or list box

$
0
0

Hi

 

I need to create a drop down list like this one. I don't know how?

Who can help me with this?

 

 

Image 1.png

Summing function Wm(time,a,b,c,d) from m=0 to m=n ?

$
0
0

To all,

 

I am sure I saw something about how to do such thing but I cannot find it so needs some pointers

 

I have a function (see attached mcad sheet) Wm(t,am,bm,cm,dm) where t is time and am,bm,cm,dm are coefficient valid for equation m

I need to do sum of Wm from m =0 to n:  Capture.PNG    but I am struggling with indices in mcad

Coudl anyone refreshe my memory on this summation? It might be something with "dicretizing" the time 't' if I recall

 

Thanks

 

Regards

 

JXB

Viewing all 680 articles
Browse latest View live


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