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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

relations

ptc-218373
1-Newbie

relations

I'm trying to set up relations that automatically generate a material stock code, based on the combination of two other parameters that governmaterial type and thickness. Everything works fine for thicknesses that are listed, but I'm wanting the stock code to display "-" if a thickness is used that doesn't exist in the listing, and it's not working; the stock code doesn't change. The below is a partial listing. Anyone know how to make this work?



IF RAW_MAT_SPEC == "RAW PLATE-44W" & THICK == '2_1/2'
RAW_MAT_STOCK_CODE = "202-015"
ELSE
IF RAW_MAT_SPEC == "RAW PLATE-44W" & THICK == '3'
RAW_MAT_STOCK_CODE = "202-016"
ELSE
IF RAW_MAT_SPEC == "RAW PLATE-44W" & THICK == '3_1/2'
RAW_MAT_STOCK_CODE = "202-017"
ELSE
RAW_MAT_STOCK_CODE = "-"
ENDIF
ENDIF
ENDIF



Thanks in advance,


Dave Tate
Peerless Trailers, Penticton, BC


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.
2 REPLIES 2

Dave,

First, initialize in case none of your conditions match. Then make each IF
stand alone.

RAW_MAT_STOCK_CODE = "-"
IF RAW_MAT_SPEC == "RAW PLATE-44W" & THICK == '2_1/2'
RAW_MAT_STOCK_CODE = "202-015"
ENDIF
IF RAW_MAT_SPEC == "RAW PLATE-44W" & THICK == '3'
RAW_MAT_STOCK_CODE = "202-016"
ENDIF
IF RAW_MAT_SPEC == "RAW PLATE-44W" & THICK == '3_1/2'
RAW_MAT_STOCK_CODE = "202-017"
ENDIF

Alternatively,
RAW_MAT_STOCK_CODE = "-"
IF RAW_MAT_SPEC == "RAW PLATE-44W"
IF THICK == '2_1/2'
RAW_MAT_STOCK_CODE = "202-015"
ENDIF
IF THICK == '3'
RAW_MAT_STOCK_CODE = "202-016"
ENDIF
IF THICK == '3_1/2'
RAW_MAT_STOCK_CODE = "202-017"
ENDIF
ENDIF

Bob Monat
Jerand Technical Services, Inc.
bob@jerand.com
www.jerand.com
1-317-875-6087


On Wed, May 23, 2012 at 5:41 PM, David Tate
<davidtate@keystrokedesigns.ca>wrote:

> I'm trying to set up relations that automatically generate a material
> stock code, based on the combination of two other parameters that
> govern material type and thickness. Everything works fine for thicknesses
> that are listed, but I'm wanting the stock code to display "-" if a
> thickness is used that doesn't exist in the listing, and it's not working;
> the stock code doesn't change. The below is a partial listing. Anyone know
> how to make this work?
>
>
>
> IF RAW_MAT_SPEC == "RAW PLATE-44W" & THICK == '2_1/2'
> RAW_MAT_STOCK_CODE = "202-015"
> ELSE
> IF RAW_MAT_SPEC == "RAW PLATE-44W" & THICK == '3'
> RAW_MAT_STOCK_CODE = "202-016"
> ELSE
> IF RAW_MAT_SPEC == "RAW PLATE-44W" & THICK == '3_1/2'
> RAW_MAT_STOCK_CODE = "202-017"
> ELSE
> RAW_MAT_STOCK_CODE = "-"
> ENDIF
> ENDIF
> ENDIF
>
>
>
> Thanks in advance,
>
> Dave Tate
> Peerless Trailers, Penticton, BC
>

My thanks to those who responded - it turned out that my problem was
caused by a different issue: my relations also include a string
conversion of the real dimension to allow for variations:

IF THICKNESS == .28 | THICKNESS == .281 | THICKNESS == .2813
THICK = '9/32'
ELSE
IF THICKNESS == .313 | THICKNESS == .31 | THICKNESS == .312 |
THICKNESS == .3125
THICK = '5/16'
ELSE

so when the THICKNESS is modified to something that is out of the
listing range, the THICK value would not update. The solution was to
add the line
THICK = '0'
at the beginning of the above range.

Quoting David Tate <davidtate@keystrokedesigns.ca>:

> I'm trying to set up relations that automatically generate a
> material stock code, based on the combination of two other
> parameters that govern material type and thickness. Everything works
> fine for thicknesses that are listed, but I'm wanting the stock code
> to display "-" if a thickness is used that doesn't exist in the
> listing, and it's not working; the stock code doesn't change. The
> below is a partial listing. Anyone know how to make this work?
>
> IF RAW_MAT_SPEC == "RAW PLATE-44W" & THICK == '2_1/2'
> RAW_MAT_STOCK_CODE = "202-015"
> ELSE
> IF RAW_MAT_SPEC == "RAW PLATE-44W" & THICK == '3'
> RAW_MAT_STOCK_CODE = "202-016"
> ELSE
> IF RAW_MAT_SPEC == "RAW PLATE-44W" & THICK == '3_1/2'
> RAW_MAT_STOCK_CODE = "202-017"
> ELSE
> RAW_MAT_STOCK_CODE = "-"
> ENDIF
> ENDIF
> ENDIF
>
> Thanks in advance,
> Dave Tate
> Peerless Trailers, Penticton, BC
>
>
Top Tags