×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Formulas

Formulas

Formulas

(OP)
I am looking to do simple math where the math function is parameter driven.
ex. 6 (a parameter equal to + or -) 6
      6+6 or 6-6
Is this even possible? If so, what type of parameter would work and could i get a simple example of it used in a formula?

Thanks in advance,
forfun
      

RE: Formulas

Forfun - parameters - real for just a number, length for using later as a dimension
formula - use the FX icon to create parameters.
if you double pick on the parameter in the tree, you can do the math in the box- just type 6+6 or (6-3)*2 ... and the math is done.  If you have a parameter set to length then you could set your units to inches (globally in tool options) but in the parameter window type 6mm  Catia will switch this to inches automatically.
If you want to tie a formula to a parameter use the formula editor via the FX icon or contextual menu inside the parameter editor menu -- edit formula

Regards,
Derek

RE: Formulas

Additionally, you can set two parameters, and use them in a math function elsewhere.

For example, set up 2 independent parameters, calling one of them X, and one of them Y.  Set the values to Real.  Go to the place you want to create the formula - let's say, the length of a line. (for simplicity)  You would open the formula editor, pick the line in space, select the proper line variable, (which is length) and then select the "add formula" option.  In the blank white line, type your formula - X+Y. (or X-Y)

What you will get is exactly what you've just asked for, and you can control the variables from the tree.

---
CAD design engineering services -  Catia V4, Catia V5, and CAD Translation.  Catia V5 resources - CATBlog.

RE: Formulas

(OP)
I am sorry my question is not very clear as it was written in haste. Given some more thought, I don't know as it would be the time saver I thought it would be anyway. But more out of curiosity now, here goes the question again.  

Below are two examples, example a, is how I would do it now. The parameters (AAA, BBB, & CCC) would be rule driven. In example b, the way I thought I wanted to do it, a single parameter (math) would be rule drive. Parameters AAA, BBB, & CCC would be formula driven. My problem is that if the parameter math is a string, I can’t seem to get the formulas to work. Does math need to be something other than a string?

example a

    if Direction == "XXXX"
    {
    AAA= a+b
    BBB= c+d
    CCC= e+f
    }
    else
    {
    AAA= a-b
    BBB= c-d
    CCC= e-f
    }

example b

    if Direction == "XXXX"
    math= "+"
    else
    math= "-"


    parameters
    AAA = a(math)b
    BBB = c(math)d
    CCC = e(math)f

Thanks Again,
forfun

RE: Formulas

Create another parameter and set it to either +1 or -1.  Then multiply your b,d, or f parameters times that parameter and simply add them.  As for the if portion, I think you need a KWA Rule for that part.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources