Finding if a feature is suppressed with relations?

Discussion in 'Pro/Engineer & Creo Elements/Pro' started by Guest, Oct 23, 2007.

  1. Guest

    Guest Guest

    I don't know the best way to accomplish the following:

    I have a generic part with one family table instance.
    The instance only has one suppressed feature.

    I want a relation that changes a dimension based on the suppression
    state of that feature.
    If the feature (ID 318) is not suppressed, the dimension (M) = <my
    formula>.
    If the feature is suppressed the dimension = 0.

    Here's what I tried (unsuccessfully):

    IF EXISTS("fid_318")
    M=.03*(tan(E/2))
    ELSE
    M=0
    ENDIF

    I would appreciate any help.

    Todd
     
    Guest, Oct 23, 2007
    #1
  2. Guest

    graminator Guest

    Why not create a parameter with the value that you want your dimension
    to be (real number)? Create a relation so that your dimension M =
    parameter.
    Then in your family table add a column for the parameter and set its
    value to .03*(tan(E/2)) and 0 for your respective instances.

    Now.... I expect your dimension M is being referenced in another
    relation otherwise why would you set it to zero if the feature it
    comes from is suppressed? Whether your relation will read the correct
    value of M=0 from a suppressed feature I don't know. But if possible
    you might want to go straight to the parameter for your value, so that
    the relation refers to the parameter rather than the dimension M from
    your family table instance.

    Make sense?
     
    graminator, Oct 23, 2007
    #2
  3. Guest

    Janes Guest

    I don't know the best way to accomplish the following:

    I have a generic part with one family table instance.
    The instance only has one suppressed feature.

    I want a relation that changes a dimension based on the suppression
    state of that feature.
    If the feature (ID 318) is not suppressed, the dimension (M) = <my
    formula>.
    If the feature is suppressed the dimension = 0.

    Here's what I tried (unsuccessfully):

    IF EXISTS("fid_318")
    M=.03*(tan(E/2))
    ELSE
    M=0
    ENDIF

    I would appreciate any help.

    Todd

    Some thoughts
    a.. Any error messages could be of some help
    b.. I would check the Help for Parameters/Relations; I believe your syntax is wrong for using fid_
    Here's what the Help says:
    Passing Strings as Arguments in Relations
    The following functions allow you to pass strings as arguments:

    a.. string_length()-Returns the number of characters in a parameter. For example, if the value for the string parameter material is defined as steel, string_length(material) equals 5, because the word "steel" has five letters.

    b.. rel_model_name()-Returns the current model name. For example, if you are currently working in a part called A, rel_model_name() is equal to A. To use this in a relation in an assembly, write the relation as follows:

    name = rel_model_name:2()

    Note: The parentheses ( ) are empty.

    a.. rel_model_type()-Returns the current model type. If you are working in Assembly mode, rel_model_type() is equal to assembly.

    b.. exists()-Evaluates whether an item, such as a parameter or dimension, exists. This can apply to the model for which the relation is being evaluated, or to any model, component, or submodel structure.

    For example:

    a.. if exists("d5:20")-Checks if the model with runtime ID 20 has a dimension d5.

    b.. if exists ("par:fid_25:cid_12")-Checks if the feature ID 25 in the component ID 12 has parameter par.

    This allows evaluation to be based on a parameter that exists in only one part of a large assembly. For example, suppose that there are several systems in a large assembly (such as hydraulic, pneumatic, or electrical systems), but the majority of objects belong to no system.

    In this case, to make evaluations that are based on the parameter, you must assign the appropriate parameter to those models that belong to the system. For example, if items in the electrical system must use a part number in the BOM report table, instead of the model name, you can create a report parameter bom_name and write the following relation:

    if exists("asm_mbr_cabling")
    bom_name = part_no
    else
    bom_name = asm_mbr_name
    endif
     
    Janes, Oct 23, 2007
    #3
  4. Guest

    graminator Guest

    Ug, I thought I replied to this but it's not there.
    Make a parameter "X" with a real number value. Set the relation:M=X

    Then in your family table instance add a column for the parameter X.
    Set your instance value to zero, your generic value to .03*(tan(E/2)).

    So your family table drives the parameter X and X drives your
    dimension M.

    I take it you want to set M to equal zero in a suppressed feature
    because there is another relation somewhere that uses it? I don't know
    if the value will regenerate for M in a family table instance when the
    feature the dimension references is suppressed, but if you can you
    might want to change the relation so that it refers back to the
    parameter X rather than the dimension M. Because the parameter will
    always be available to be used even if dimension M isn't.

    Does that make sense?
     
    graminator, Oct 23, 2007
    #4
  5. Guest

    Janes Guest

    I don't know the best way to accomplish the following:

    I have a generic part with one family table instance.
    The instance only has one suppressed feature.

    I want a relation that changes a dimension based on the suppression
    state of that feature.
    If the feature (ID 318) is not suppressed, the dimension (M) = <my
    formula>.
    If the feature is suppressed the dimension = 0.

    Here's what I tried (unsuccessfully):

    IF EXISTS("fid_318")
    M=.03*(tan(E/2))
    ELSE
    M=0
    ENDIF

    I would appreciate any help.

    Todd

    Family tables are lovely because, for one, they present the opportunity to take the same part and vary it in any number of ways. One would be, as you are doing, by suppressing a feature, others by varying feature dimensions or locations. I don't see why, when you are suppressing a feature, you can't, simultaneously, change another feature so that its dimensions are unique to that table instance. You just need to add the feature dimension to the family table. And the instance you're trying to generate will have one feature that doesn't regenerate and another that regenerates at a particular value. I really don't see why you even need relations for this. Put it ALL in the table and forget the relations.

    David Janes
     
    Janes, Oct 24, 2007
    #5
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.