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

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Calling all Relations guru's -- smart bom with an attitude

TerryJohnson
1-Newbie

Calling all Relations guru's -- smart bom with an attitude


so, I need to delete the NAS & SAE numbers the parameters are in the parts
list.
these are library parts that have this parameter in them when they
shouldn't

  I tried it using the part numbers, and doing each one separately
but the only thing that happens is if I use asm_mbr_partnumber the sort
order changes
I really don't want to have to delete parameter that drives this column and
type in the ones I want 😞

if asm_mbr_documentno == "NASM51959"
asm_mbr_documentno = "  "
if asm_mbr_documentno == "NASM35338"
asm_mbr_documentno = "  "
if asm_mbr_documentno == "SAE-AS25036"
asm_mbr_documentno = "  "
if asm_mbr_documentno == "NASM24693"
asm_mbr_documentno = "  "
endif
endif
endif
endif





                                                      
                                                      
                                                      

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


& the relations I had listed below caused all the washers (not affected by
this, not tied to these numbers in any way) to loose their quantities
wth??







TomU
23-Emerald IV
(To:TerryJohnson)

Three things.


1.) Don't assume the parameter will always exist in every part unless your 100% it will always be there. Evaluating a relation for a parameter that does not exist will cause all relations evaluation for that particular part (repeat region row) to fail. Instead, use the IF EXISTS functionality to verify a parameter actually exists first.

IF EXISTS("asm_mbr_documentno")

<do stuff=">

ENDIF



2.) You do not want to nest all the IF statements inside each other. Each should either stand alone or be part of a single IF statement. Pipe symbol (|) is "OR". You can continue to multiple lines with the back slash ( \ ).
IF asm_mbr_documentno == "NASM51959" | asm_mbr_documentno == "NASM35338" | asm_mbr_documentno == "NASM24693"
<do stuff=">
ENDIF
OR

IF asm_mbr_documentno == "NASM51959"

<do stuff=">

ENDIF

IF asm_mbr_documentno == "NASM35338"

<do stuff=">

ENDIF

IF asm_mbr_documentno == "NASM24693"

<do stuff=">

ENDIF



3.) You may have trouble trying to change the actual parameter of the value you are reading in. (I'd have to double check this.) You're probably better off creating your own parameter for use in this repeat region column and then setting it based on your if statements. (Repeat region parameter would be "&rpt.rel.<parameter name=">".) Something like this:
IF EXISTS("asm_mbr_documentno")
DOCNUM = asm_mbr_documentno
ELSE
DOCNUM = "
ENDIF

IF DOCNUM == "NASM51959" | DOCNUM == "NASM35338" | DOCNUM == "NASM24693"

DOCNUM = "
ENDIF

Tom U.

P.S. Don't try copying and pasting directly from email to Pro/e. There are some slight character differences that can make the relations fail.

I added rpt.rel. user defined docno
and this (see below) and it worked!
Thank you thank you thank you!! I guess it was the if exists I was missing
in all my attempts!  Thank you Tom!! You ROCK!

---- RELATION -----

IF EXISTS ("asm_mbr_documentno")
docno= asm_mbr_documentno
endif
IF asm_mbr_documentno == "NASM51959" | asm_mbr_documentno == "NASM35338" |
asm_mbr_documentno == "NASM24693" | asm_mbr_documentno == "SAE-AS25036"
docno= " "
ENDIF







TomU
23-Emerald IV
(To:TerryJohnson)

Realize that your second IF statement should be inside the first, otherwise it will still fail if the parameter doesn’t exist (because it’s outside the IF EXISTS statement). Either that or change your second IF statement to only evaluate docno instead of asm_mbr_documentno. You probably should also set a default value for docno so it doesn’t inadvertently retain the previous row’s value if the parameter doesn’t exist.

docno= “”
IF EXISTS ("asm_mbr_documentno")
docno= asm_mbr_documentno
ENDIF
IF docno == "NASM51959" | docno == "NASM35338" | docno == "NASM24693" | docno == "SAE-AS25036"
docno= " "
ENDIF

Thanks when I opened it this morning I found  most of my quantities had
vanished,  this fixed it!






Top Tags