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 PTC Community Badges. Engage with PTC and see how many you can earn! X

Pattern by Relation

jbob
12-Amethyst

Pattern by Relation

I am trying to create a pattern in only one direction using relations. I have read all the other post I could find about this topic and I could use some advice. The pattern increments will not be the same, I could use a pattern table but I want to use the dimensions in a relation and I cannot if they are in a pattern table. I also do not wish to create a family table of this model. Here is what I have tried to date, in the part relations I create an integer parameter,

If pattern_1 == 1

p47 = 4

endif

in the pattern relation table I have this

If pattern_1 == 1

if idx1 == 1

memb_i = 2.250

if idx1 == 2

memb_i = 3.000

if idx1 == 3

memb_i = 3.000

endif

endif

endif

endif

this results in this first member is correct, the second is on top of the first, the third is double the distance of the first and the fourth is also on top of the first.

I also tried

If pattern_1 == 1

if idx1 == 1

memb_v = lead_v + 2.250

if idx1 == 2

memb_v = lead_v + 5.250

if idx1 == 3

memb_v = lead_v + 8.250

endif

endif

endif

endif

this results in the first two members in their correct location but the third and fourth members on top of the first member. What am I doing wrong?

ACCEPTED SOLUTION

Accepted Solutions
jbob
12-Amethyst
(To:jbob)

I did figure out my mistake, I did not include the else in the relation

If pattern_1 == 1

if idx1 == 1

memb_i = 2.250

else

if idx1 == 2

memb_i = 3.000

else

if idx1 == 3

memb_i = 3.000

endif

endif

endif

endif

View solution in original post

2 REPLIES 2
jbob
12-Amethyst
(To:jbob)

I did figure out my mistake, I did not include the else in the relation

If pattern_1 == 1

if idx1 == 1

memb_i = 2.250

else

if idx1 == 2

memb_i = 3.000

else

if idx1 == 3

memb_i = 3.000

endif

endif

endif

endif

KenFarley
21-Topaz I
(To:jbob)

Your logic is incorrect with respect to the if statements.

What you are essentially saying with, for example, the first set of if statements is:

if idx is 1, set the increment to 2.250

otherwise, do no other actions.

You have all of your if statements nested within the first one, meaning that if idx1 is not equal to 1, none of the other ones will be evaluated.

What you should have is something like

if idx1 == 1
  memb_i = 2.250
endif
if idx1 == 2
  memb_i = 3.000
endif
if idx1 == 3
  memb_i = 3.000
endif

The second set of if statements with memb_v is probably also not logically correct.

Announcements
NEW Creo+ Topics: Real-time Collaboration


Top Tags