Continue to Site

Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

Repeat region relation syntax?

jabster42

New member
Hi.

Could someone please point me towards a reference for "if..then..else" syntax and formats for relations within repeat regions?

I am trying to create a table relation like this:
if cust_pn exists
cust_pn=cust_pn
else
cust_pn=asm_mbr_name
endif

cust_pn is a parameter in each part with a family table.

Basically, I am trying to find a way to always have the main part number show up in a BOM, instead of the family table instance name. (ie: "506-00100" instead of "506-00100-063_panel").

I can do this on a per part basis ("if cust_pn=="506-00100-063_panel" then cust_pn="506-00100") but would like it to happen automagically, without having to go thru each part every time .

Unless someone has a better solution for handling family table part numbers in a BOM?

I've been looking at this page for reference:
http://www.proecentral.com/portal/articles/articlesDetail.as p?id=22

Thanks,
John
 
Maybe I don't understand your problem, but I'll give it a try.


If you want to show just a portion of your part_number like on the examples shown here [url]http://www.proecentral.com/portal/articles/articlesDetail.as p?id=22[/url]than I think you should add a relation for every part like you said (if cust_pn=="506-00100-063_panel" then cust_pn="506-00100")


But rather than adding a relation for every part, you could add that "cust_pn" parameter to the family table and fill every line with what part number youlike. Then add "cust_pn" to the BOM.I think this way it will be faster. And if someone is adding a new instance to the family table will see the "cust_pn" parameter and fill it accordingly.
 
vlad1979 said:
But rather than adding a relation for every part, you could add that "cust_pn" parameter to the family table and fill every line with what part number youlike. Then add "cust_pn" to the BOM.

Problem with that method is going back to every already released part and adding that parameter.

I'd think my way should work, I just need that initial "if exists" comparison.

-john
 
I don't have a repeat region to work on right now, but give it a try. I think is something like:


if exists("asm_mbr_cust_pn")
 
Vlad,

That exist check seems to work, as I am no longer getting a syntax error. Here's what I have now.

if exists("asm_mbr_custpn") custpn=custpnelse custpn=asm_mbr_nameendif

Where custpn is a parameter in the part with a family table.

However, with that relation setup, the only part number I get now is 597-00001. All the parts that do not have that parameter are blank in my BOM, where I want asm.mbr.name to display.

Is my logic screwed up here? Something else?

What really confuses me is that even this doesn't work: asm_mbr_custpn=asm_mbr_name
Everything is still blank except for the one part with a custpn parameter.

thanks,
john
 
Uugh.

This is driving me nuts.

Here's what I have now:
1. I have changed the BOM table column from asm.mbr.name to rpt.rel.stpartno
2. Here's my relation file:
if exists("asm_mbr_CUSTPN") stpartno=asm_mbr_CUSTPNelse stpartno=asm_mbr_nameendif

With this, the one part with a CUSTPN paramater displays correctly in the part number column. For the rest of the column, each cell has the same contents (751-00012). 751-00012 is the last entry in my BOM (it's sorted numerically).

This, naturally, works:
if asm_mbr_name=="597-00001-063_PANEL" stpartno="597-00001"else stpartno=asm_mbr_nameendif
But that's precisely what I'm trying to avoid--doing it on a per part number basis.

Any ideas?

thanks,
john
 
I tried the following:


Made 2 parts: part1 with a parameter "custom" filled with X


part2 without parameter "custom"


Made a assy and a drawing with a repeat region showing &rtp.rel.stpartno


Then I entered the relations in the repeat region:


if exists("asm_mbr_custom")<BR style="FONT-WEIGHT: bold"> stpartno=asm_mbr_custom<BR style="FONT-WEIGHT: bold">else<BR style="FONT-WEIGHT: bold"> stpartno=asm_mbr_name<BR style="FONT-WEIGHT: bold">endif


And it works fine. Part 1 is displaying X and part2 is displaying it's pro-e name.


What I found is that when I change the relations and the parameter with "custpn" it doesn't work anymore. I guess "custpn" it's a default PRO_E parameter (I don't see any other explanation). These relations are working for any parameter name but not "custpn".


But let me ask you something else: that parameter "custpn" that you have in every family table, is it filled with something or is it empty?
 
Here is the code I use to change the quantity. As you can see by the comment at the bottom, I'm using a custom parameter. I think this is what you need to do...





If asm_mbr_pn == "23-3100"
my_qty = "REF"
Else
if asm_mbr_pn == "20520066"
my_qty = "REF"
Else
if asm_mbr_pn == "20521234"
my_qty = "REF"
Else
my_qty = rpt_qty
EndIf
EndIf
EndIf



/*** Replace "rpt.qty" with "&rpt.rel.my_qty" in repeat region.
 
vlad1979 said:
What I found is that when I change the relations and the parameter with "custpn" it doesn't work anymore. I guess "custpn" it's a default PRO_E parameter (I don't see any other explanation). These relations are working for any parameter name but not "custpn".
Oddly enough "custom" is the ONLY parameter that will work. Tried custompbforbom, pnforbom, and a few others. Only the parameter "custom" in the part actually works.





But let me ask you something else: that parameter "custpn" that you have in every family table, is it filled with something or is it empty?

I'm not putting "custom" in the family table. It's only in the generic part, which means it's actually in all parts. In my situation, I've got a part with a nut, and I'm creating a family table to accommodate different panel thicknesses. So it's always the same PN in the BOM.

dross: I have had no problem with quantity and description changes. For some reason, only the value showing up for the part number has been an issue.

FWIW, I'm running ProE 2001, ManufCode 2001440

thanks for the assistance,
john
 
Well, almost works correctly.

The other thing that I have to do, is add a column to my BOM table, entering the text asm.mrb.custom.

Once I regen the draft, then "custom" shows up in the new column, and the "custom" number magically appears in the PART NO column.

I can then delete the newly added column with no ill effects.

No idea why I need to temporarily add that column. Bug in this build maybe?

-john
 
I don't know, I'm using WF2 and had some similar problems today. I was too, working with a repeat region and for some reason it didn't updated. I had to delete the model from the drawing, put it again and only then the repeat region worked.
 
if exists("cust_pn")

else
cust_pn=asm_mbr_name
endif



Rember to have the parameter... you already have the value... don't reassign it...


Also, check to put a "not" to remove the else


or try something like this :


if exists("cust_pn")
val=cust_pn
else
val=asm_mbr_name
endif


and use the parameter val
 

Sponsor

Back
Top