I have Repeat Region Relations that work in one drawing table but if I put that table in another drawing of the same model, the relations no longer work. Here's the relations:
IF EXISTS ("ASM_MBR_DESC")
IF ASM_MBR_DESC == "FLEX BODY"
IF ASM_MBR_DESC == "NON-FLEX BODY"
RELSHOWNAME = ASM_MBR_D_LB_DWG
If my new table has a column with ASM_MBR_D_LB_DWG or ASM_MBR_D_UB_DWG the relations work, but if I remove the columns, the relations quit working and I see this in the message window: There are errors regenerating repeat region relations.
Anyone know what's going on here??
I'm no repeat region relations expert, but are those two parameters present at the bottom of the relations window? If not, add them and see if that does it.
I remember trying to add a relation that substituted A/R for the qty on bulk items and I had to manually add parameters in the relations window, even repeat region parameter like rpt_qty. See this thread:
if I add those columns, the parameters are added to the relations parameters as type unknown, but the relations work as intended. If I then remove those columns, the parameters in the relations editor are gone as well. If I create the parameters in the relations editor, as type string, they remain type string and do not change with the relations, but they do appear in the table. I guess I forgot to mention that when the relations do not work, the two table cells I'm trying to change with conditional statements are empty.
Here is a great article about repeat regions.
This was referenced at the end of this string:
Did you try to reboot and the problem go away?
Seriously, I tried to to replicate your problem and managed to get weird results that might be a clue as to how to solve your issue:
I don't have a file set with your parameters, but I definitely got into some trouble when I deleted a parameter that was used in this repeat region relation:
TYPE_STRING = "** Present"
TYPE_STRING = "Missing"
(the drawing has a repeat-region table with a column that has the entry "&rpt.rel.TYPE_STRING"; which will either show "** Present" if the component listed in the particular row has the parameter "FILE_TYPE", or it will show "Missing" if it doesn't - note my test assembly had a mix of both types of parts).
When I intentionally deleted the ASM_MBR_FILE_TYPE parameter in the repeat region relation ui's local parameter list, and then regenerated the drawing, the relation no longer worked (as expected - every row was filled with "Missing").
When I then tried to recreate the parameter ASM_MBR_FILE_TYPE, either by temporarily creating the extra table column which showed the component parameter "FILE_TYPE", or simply by manually adding a Real Number parameter "ASM_MBR_FILE_TYPE" to the local parameter list, the the relation no longer worked (all rows were now showing "** Present". Also note that the parameter ASM_MBR_FILE_TYPE did change to the "Unknown" type.
But what actually worked, incredibly, was simply going into the actual text of the relations (lines 01-05 above) and making a non-change - for example, retyping the word "endif" on line 05. After that, the relation prescribed in the very same looking 5 lines actually worked...
Maybe the same thing is happening to you in some way - try making a similar non-change in your relations of the repeat region in the new drawing and see if that helps... I doubt it because I don't actually get the message "There are errors regenerating repeat region relations", but who knows???
Try the following code and make sure you've got &rpt.rel.RELSHOWNAME in one of the repeat region table fields.
IF EXISTS("ASM_MBR_D_UB_DWG") & EXISTS("ASM_MBR_D_LB_DWG")
IF DESCDUMMY=="FLEX BODY"
IF DESCDUMMY=="NON-FLEX BODY"
I spent some time on testing the problem in CR2 M070.
1.] IF EXISTS ("ASM_MBR_DESC") command does not work in repeat region relation
2.] all assembly members must contain the same set of parameters, this means:
2.] all parameters used in repeat region relation must be included in repeat region cell
4.] to "hide" unwanted parameters I set their height to 0.01 mm
5.] you can use attached table, if you fulfil the above rules
The required parameters will automatically be added to the repeat region parameters section if you add them to one of the repeat region columns (like MartinHanak mentioned), or you can just manually add them to the repeat region parameters section yourself. They do NOT need to be in a (hidden) column of the table.
Finally, "IF EXISTS" does work in repeat region relations (and this is the only place it works). See this discussion for a sample: Relations in drawing BOM
Let me know if you need screenshots demonstrating all of this.
I am publishing what I have learned .
Create table, define repeat region and put parameter into it.
Open relations dialog box, define parameters used in relations and enter relations.
See attached table.