cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

model relation

thlavinka
1-Newbie

model relation

Hello, I have a question regarding relations:

I use following relation in model to show raw material dimensions in drawing BOM.

if NORMA == "9000010"

      ROZMER = "-"

else

     ROZMER="PL" + ITOS(LENGTH:FID_MEASURE_LENGTH_1) + "-" + ITOS(DISTANCE:FID_MEASURE_DISTANCE_1) + "X" + ITOS(DISTANCE:FID_MEASURE_DISTANCE_2)

endif 

For normalized parts of a family table I need to suppress those dimensions by relation which filters all parts with a parameter "NORMA" stating with 90000 (not only 9000010).


Thanks in advance


Tom


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
ACCEPTED SOLUTION

Accepted Solutions
mbonka
15-Moonstone
(To:thlavinka)

Zdravím do Pelhřimova,

Greatings to Pelhrimov,

don´t know your exact situation, but will give you some generall tips.

Generall ideas:

- Is NORMA string or integer? Perhaps it is string type.

- you got some company NORMAs standards, that you have to insert in ProE logical relations ---> does it need more complex relation?

- what FORMs can be parameter NORMA? ---> Exampes: DIN933; CSN EN; 900010 and other internal company standards... ---> is my relation enough inteligent? ---> will be 100% funcionality in each possibilities options?

01) STRING type relation:

Princip:

- use EXTRACT function

- use help parameter NORMA_CATAGORY

- see ProE help or PTC community for more informations

Relation:

NORMA_CATEGORY=extract(NORMA,1,3)

IF NORMA_CATEGORY=="900"

ROZMER = "ABC"

ELSE

ROZMER="---"

ENDIF

Norma-string_type.jpg

-------------------------------------------------------------------------------------

02) INTEGER type relation:

Princip:

- use standard mathematical logic ---> IS it greater than 9000 AND smaller than 10000 ?

Relation:

IF NORMA >= 9000 & NORMA < 10000

ROZMER = "ABC"

ELSE

ROZMER = "---"

ENDIF

Norma-integer_type.jpg

Hope it can helps you.

Greatings

Milan

View solution in original post

6 REPLIES 6
TomU
23-Emerald IV
(To:thlavinka)

Since NORMA is a string, you can use the SEARCH() function to see if part of it exists.  For example,

IF SEARCH(NORMA, "90000") > 1

    ROZMER = ""

ELSE

    IF NORMA == "9000010"

        ROZMER = "-"

    ELSE

            ROZMER="PL" + ITOS(LENGTH:FID_MEASURE_LENGTH_1) + "-" + ITOS(DISTANCE:FID_MEASURE_DISTANCE_1) + "X" + ITOS (DISTANCE:FID_MEASURE_DISTANCE_2)

    ENDIF

ENDIF

thlavinka
1-Newbie
(To:TomU)

Tom,

Thank you for so quick answer.

I tried to write a relation according to you, but the result is still the same. Below I put a printscreen of drawing boom where all three items with numbers in collumn "NORMA" should have "-" in collumn "ROZMER"

2016-03-05_190339.jpg

TomU
23-Emerald IV
(To:thlavinka)

Is Rozmer a parameter in your model, or only in the repeat region?  If you look at the cell properties at the top of that column, does it show something like &asm.mbr.Rozmer or &rpt.rel.Rozmer?

thlavinka
1-Newbie
(To:TomU)

It is a model parameter ( &asm.mbr.Rozmer)

mbonka
15-Moonstone
(To:thlavinka)

Zdravím do Pelhřimova,

Greatings to Pelhrimov,

don´t know your exact situation, but will give you some generall tips.

Generall ideas:

- Is NORMA string or integer? Perhaps it is string type.

- you got some company NORMAs standards, that you have to insert in ProE logical relations ---> does it need more complex relation?

- what FORMs can be parameter NORMA? ---> Exampes: DIN933; CSN EN; 900010 and other internal company standards... ---> is my relation enough inteligent? ---> will be 100% funcionality in each possibilities options?

01) STRING type relation:

Princip:

- use EXTRACT function

- use help parameter NORMA_CATAGORY

- see ProE help or PTC community for more informations

Relation:

NORMA_CATEGORY=extract(NORMA,1,3)

IF NORMA_CATEGORY=="900"

ROZMER = "ABC"

ELSE

ROZMER="---"

ENDIF

Norma-string_type.jpg

-------------------------------------------------------------------------------------

02) INTEGER type relation:

Princip:

- use standard mathematical logic ---> IS it greater than 9000 AND smaller than 10000 ?

Relation:

IF NORMA >= 9000 & NORMA < 10000

ROZMER = "ABC"

ELSE

ROZMER = "---"

ENDIF

Norma-integer_type.jpg

Hope it can helps you.

Greatings

Milan

Greetings from Brno 🙂

Meanwhile I have already done a simple relation like following:

IF NORMA == "-"

        ROZMER="PL" + ITOS(LENGTH:FID_MEASURE_LENGTH_1) + "-" + ITOS(DISTANCE:FID_MEASURE_DISTANCE_1) + "X" + ITOS (DISTANCE:FID_MEASURE_DISTANCE_2)

    ELSE

            ROZMER="-"

ENDIF

....that is enough for that case but thank you very much for the EXTRACT function explanation which I can use for another ones.

Tom

Announcements
NEW Creo+ Topics: Real-time Collaboration


Top Tags