Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Variable formula

Status
Not open for further replies.

mdrummond

Industrial
Feb 21, 2008
37
0
0
US
I am trying to make a feature for a snap ring groove. I'd like to be able to insert a library feature tht will have a formula that checks that my shaft diameter is say if equal to .500", then it'll make my groove diameter A and with B. Any hints on this?
 
Replies continue below

Recommended for you

Hi,

no chance. The formula as well as the variables won't be
copied to the feature library. The dimensions will have
those values they had when the feature was copied to
the library.

dy
 
OK, forget the library part. how would I go about tying the groove OD to the shaft OD. To expand on this, I basically want a feature that can take the shaft diameter and apply the groove OD and width dimensions to suit. My snap ring catalogue gives me the groove OD and width based on the shaft diameter. So If shaft Diameter is equal to 0.125 then groove OD = the predefined value.
 
mdrummond,

There are a couple of options depending on the "size" of your catalog.

Option 1 - Good if you have a small number of possibilities
You can link the variable using statements in the variables table. This is good if you have say 2 or 3 possible dimensions.

Option 2 - Good if you have a large number of possibilities
You can create an excel spreadsheet and link this to your variable table. Your excel spreadsheet in this instance will hold your catalog. Good for more than a couple possibilities.

Please let me know which one suits more your needs as I can expand on these methods further.

Cheers,
Martin
 
I was afraid you were going to say that.

In this example I'll make reference to a simple tube where my length will impact the OD and ID, but you can change it to whatever you like. I'll assume you know how to go into your variables table and play around with it a bit. Remember to save your work often. Ok, let's get started.

So you build a part, and it has three variables; Inner Diameter (ID), Outer Diameter (OD) and Extrude Length (L). Make a forth, scalar variable and make it equal to L (difference here is that it has no units). Great. Now open up a new excel spreadsheet. Name three columns L, OD, and ID. Fill in the space underneath these names with the values you want. Next, your gonna Right-click on the scalar variable (in SE) and click on "copy link". In excel, special paste with link (Under Edit) in a cell underneath your table L column. This cell will update as you change the length in SE.

Next comes the tricky part. In an empty cell, write the formula "=EQUIV(A9;A2:A6;1)", where A9 is the cell of your pasted link, A2:A6 is the range of your lengths, and 1 is just there for kicks (let's imagine). This will return the value of the currently valid row of your number.

In another cell, write the formula "=INDEX(B2:B6;B8;1)", where B2:B6 is the range of OD, B8 is your equiv equation, and 1 is there for kicks. after accepting this formula, it should give you the value in the corresponding column and row previously found. Repeat for 2nd, 3rd, etc. values.

Now right-click copy the OD "index" cell. In SE, right-click on the OD variable and click on "paste link". Voila, your variable is now driven by an excel spreadsheet.

2 VARY IMPORTANT WARNINGS
First, the excel spreadsheet will always need to be open before SE for this link to work. If you close the sheet, the tube will no longer update accordingly.

Second, to my knowledge the "equiv" equation always takes the smallest value. Ex: if two rows are 40 and 50, and the input is 45, then excel will go towards 40. Also, I didn't check to see what happens if the rows are not in order.

If need be, I can provide a simple excel sheet and SE part file to illustrate what I've said here. Any other question, don't be afraid to ask.

Cheers,
Martin

P.S. I should get charge for this stuff! :p
 
Status
Not open for further replies.
Back
Top