Truncating or Rounding Parameters

Discussion in 'Pro/Engineer & Creo Elements/Pro' started by B.Reilly01, Jul 20, 2007.

  1. B.Reilly01

    B.Reilly01 Guest

    I am having difficulties figuring out how to truncate a relation
    driven parameter in Wildfire 3.0. What I have is something like this:

    (parameter) = (d1/d2)

    Which is equal to a value, say 7.856522. I want this to be an
    INTEGER. Either 7 or 8. I can work with either truncation or
    rounding.

    Any advise? I know it's probably simple, and I am just missing the
    boat.
     
    B.Reilly01, Jul 20, 2007
    #1
  2. B.Reilly01

    David Janes Guest

    I am having difficulties figuring out how to truncate a relation
    driven parameter in Wildfire 3.0. What I have is something like this:

    (parameter) = (d1/d2)

    Which is equal to a value, say 7.856522. I want this to be an
    INTEGER. Either 7 or 8. I can work with either truncation or
    rounding.

    Any advise? I know it's probably simple, and I am just missing the
    boat.

    I think you're looking for an expression like
    BIG=CEIL(d1/d2); or
    SMALL=FLOOR(d1/d2)
    which produces the largest or smallest integer which the expression can produce.
    This is neither strictly rounding nor truncating. CEIL(1.1) produces the integer 2; and FLOOR(1.9) produces the integer 1, so FLOOR is effectively truncating. CEIL, however, has no discretionary rounding capability. Pro/e's internal programming functionality, compared with SW's integration of VB, blows garbage scows. If you've got another $10-20K to blow on additional software, you can decadently indulge in (no, not in Godiva Chocolates, but) Pro/TOOLKIT, PTC's interface to the kernel functionality, thus the ability to write the code that makes up for PTC's lameness and laziness and cheapness and unresponsiveness and backwardness and carelessness and arrogance and .... (a hundred more such adjectives). For the best that Pro/e has to offer, check 'Help>Help Center>Fundementals' and search for relations or one of the above functions. And welcome to the group.

    David Janes
     
    David Janes, Jul 20, 2007
    #2
  3. B.Reilly01

    B.Reilly01 Guest

    Thank you Mr. Janes, that was exactly what I needed. I had seen the
    floor and Ceil commands, but my training didn't include those and my
    reference book doesn't mention them, so I had no idea I was staring at
    exactly what I needed. Worked perfect, again, thank you.
     
    B.Reilly01, Jul 23, 2007
    #3
  4. B.Reilly01

    David Janes Guest

    Thank you Mr. Janes, that was exactly what I needed. I had seen the
    floor and Ceil commands, but my training didn't include those and my
    reference book doesn't mention them, so I had no idea I was staring at
    exactly what I needed. Worked perfect, again, thank you.

    FYI, another thing that approximates truncation (lopping off the decimal portion of a real number) is [.0]. Placing this as &parameter[.0] results in no decimals showing in the text, effectively truncating the real number to its lowest integer value. This doesn't actually change or round anything. This only effects the display of the number.

    David Janes

    P.S. Much more arcanery left to explore. But start with the Help menu. All the time, it is making me look smart.
     
    David Janes, Jul 23, 2007
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.