Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Defining New "Built in Units"

Status
Not open for further replies.

sloth4z

Mechanical
Aug 12, 2003
132
I find that I am always inserting the following definitions at the top of every document. Is there a way to set these similar to the built in units, so I don't have to do it everytime? Or are there a similar variable that I should be using instead of these?

1 in_wg := 5.2023 lb/ft^2
1 fpm := 1 ft/min
?.s := 0.075 lb/ft^3
 
Replies continue below

Recommended for you

What version are you using? After Release 12 or 13 the help is pretty clear on how to define your own units and it isn't easy. You have to get into some pretty scary control files (the kind that an extra space will cause the program to fail). I have some units that I wanted to include, but after reading the detailed help I bailed.

Before (I think) release 12, you couldn't do it at all.

David
 
One possibility is to define all your units in a Mcad file and insert that file as a reference at the top of your worksheets (insert > reference). This is also a good way to insert user functions. Copying/pasting a collapsed area is another possibility.

If you are putting the same references into every worksheet, you can make them part of the normal template.

Peter
 
It is better to use the identical operator (three parallel lines). This way you can write it at any place on the document. You can create a file with all your definitions and when you start a new project load this file and save it with a the new name for the project.
 
Why not try the "Reference" function? (Not sure in which version this was introduced.)

Create a standard Mathcad worksheet containing your common unit definitions, functions you have created, common constants, and save as units.mcd say. (You don't need to include any standard Mathcad units, functions and constants etc.) Then at the top of your standard worksheet template, include the following expression:

Reference: c:\Mathcad\units.mcd

(Obviously, you must point to the actual path and filename.) In Mathcad 14, this is accomplished using "Insert | Reference" from the main menu - not sure of the procedure in earlier versions.

This will have the effect of inserting all of your standard definitions at the top of all of your calculations. Also, whenever you update your units.mcd file with any new definitions, all your new definitions will immediately be available in all of your worksheets.

Hope this helps!
 
pstuckey beat me to the punch!

Oh well - just goes to prove that "great minds think alike"!
 
Thanks everyone for the help. I think a collaspable area in a template will work, but I want to figure out how to define my own unit. I looked in the help as zdas04 mentioned and tried but I keep getting an error when I open up Mathcad.

I open C:\Program Files\Mathcad\Mathcad 14\units\unit-system-SI.xml
and insert the following code to define fpm (feet per minute)

<unit name="feet_per_minute" quantity-name="velocity">
<symbol name="fpm" xml:lang="en"/>
<displayName xml:lang="en">Feet per minute</displayName>
</unit>

I then open C:\Program Files\Mathcad\Mathcad 14\mpl\mcdunitsystemsi.mpl
and insert the following code

mc_fpm = rv(foot /. minute);

according to the help, that is all I need to do, but when I open up Mathcad I get an error. Can you guys help me figure this out?
 
Sorry, have tried the same with similar results. I've pretty much given up for the nonce.

TTFN

FAQ731-376
 
I usually do it this way: fpm:=60/5280mph, where "mph" is a build in unit. So, if you then type in Vel:=1mph, Vel=88fpm comes out provided you click on the solution of 1.467ft/s and put "fpm" into the place holder.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor