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

Relation to control min/max of flexible part

sk8shorty01
2-Explorer

Relation to control min/max of flexible part

Hello all,

 

I have been out of the Creo world for about 5 years and have recently been sucked back in (away from CAD).

 

I am building a strut assembly for use as a library part.  I have my family table built as well as all the relations written for dimension control other than the min/max I am struggling to figure out.  Because this is a library part that could be used across multiple projects (and for BOM purposes) I did not use mechanisms and instead made it a flexible part.

 

The strut assembly has an extension rod that gets cut to size on site, but has a min/max based on the strut model you purchase.  There are 11 different strut options, each with a separate min/max range (listed below):

 

Size A - 9.625 to 53.125

Size B - 10.125 to 99.125

Size C - 10.125 to 111.125

Size 1 - 11.375 to 110.375

Size 2 - 11.375 to 110

Size 3 - 11.375 to 108.5

Size 4 - 13 to 108

Size 5 - 13 to 106.5

Size 6 - 13 to 104.75

Size 7 - 15 to 102.5

Size 8 - 17.25 to 98

 

Because the width of said rod is different per instance, my thought was I could write some form of an IF/THEN statement where it would see the diameter of said extension rod and keep the flexible part locked between those value ranges associated.

 

Something along the lines of:

 

IF <extension rod diameter dimension> = <size a dimension>

THEN <min/max from size a>

....

And so on

 

 

Does anyone with more knowledge that a washed up Creo guy have some guidance for me?

 

 

Thanks all!

 

Mike

ACCEPTED SOLUTION

Accepted Solutions
TomU
23-Emerald IV
(To:sk8shorty01)

From the description it sounds like you are flexing a dimension in the extension rod.  Yes, it is entirely possible to have relations limiting a dimension value.  Making a dimension flexible will not allow it to exceed its relation controlled values.  For example, in the model do something like this:

 

IF MODEL == "A"
    IF ROD_LENGTH < 9.625
        ROD_LENGTH = 9.625
    ENDIF
    IF ROD_LENGTH > 53.125
        ROD_LENGTH = 53.125
    ENDIF
ENDIF

IF MODEL == "B"
    IF ROD_LENGTH < 10.125
        ROD_LENGTH = 10.125
    ENDIF
    IF ROD_LENGTH > 99.125
        ROD_LENGTH = 99.125
    ENDIF
ENDIF

...

 

When you flex the ROD_LENGTH dimension in the assembly, regardless of what value is entered, the relations will force the dimension to stay within in the allowed range.

View solution in original post

9 REPLIES 9
StephenW
23-Emerald II
(To:sk8shorty01)

I'm not using a family table but I am using a flexible dimension to control the length range of an assembly.

I suppose you could simply add in a parameter for diameter along with the length.

 

/* DIMENSION NAMED LENGTH
length=D44

/* generate error message
LENGTH >= 24
LENGTH <= 36

/* makes overall length dimension back to max for this dash number
IF D44 < 24
D44 = 24
endif
IF D44 > 36
D44 = 36
ENDIF

TomU
23-Emerald IV
(To:sk8shorty01)

From the description it sounds like you are flexing a dimension in the extension rod.  Yes, it is entirely possible to have relations limiting a dimension value.  Making a dimension flexible will not allow it to exceed its relation controlled values.  For example, in the model do something like this:

 

IF MODEL == "A"
    IF ROD_LENGTH < 9.625
        ROD_LENGTH = 9.625
    ENDIF
    IF ROD_LENGTH > 53.125
        ROD_LENGTH = 53.125
    ENDIF
ENDIF

IF MODEL == "B"
    IF ROD_LENGTH < 10.125
        ROD_LENGTH = 10.125
    ENDIF
    IF ROD_LENGTH > 99.125
        ROD_LENGTH = 99.125
    ENDIF
ENDIF

...

 

When you flex the ROD_LENGTH dimension in the assembly, regardless of what value is entered, the relations will force the dimension to stay within in the allowed range.

sk8shorty01
2-Explorer
(To:TomU)

So if I understand correctly, based on my naming convention "SWAY_STRUT_A.prt , SWAY_STRUT_B.prt" and so on.

 

I would replace to read:

 

IF MODEL == "SWAY_STRUT_A"

 

 

correct?

TomU
23-Emerald IV
(To:sk8shorty01)

I would suggest creating an extra parameter in part you want to control the length of called STRUT_MODEL (or something like that.)  Add this parameter to your family table and then set it with some value you can use to indicate which model this part is going to be used in.  I wouldn't try to rely directly on the other assembly model's names.  You don't want this to break if the assembly is duplicated or renamed.

sk8shorty01
2-Explorer
(To:TomU)

Ok so I have added a parameter to my part (keep in mind this entire strut is one part so it fills my BOM correctly) called "STRUT_SIZE" and added it to my family table with values of "A" , "B", etc.

 

So now I would write it as:

 

 

IF "STRUT_SIZE" == "A"

 

 

Or is that also not correct?

 

Sorry for all of the questions but my Creo mind is not as sharp as it used to be.  Just trying to get myself back in here and its amazing how weak my skills have become in such a short time.

TomU
23-Emerald IV
(To:sk8shorty01)

No quotes around parameter or dimension names.  Only string values need to be in double quotes.

 

IF STRUT_SIZE == "A"
    /* Do stuff
ENDIF
sk8shorty01
2-Explorer
(To:TomU)

Thank you very much for your guidance.  My poor rusty brain was hurting trying to get this to work haha!

Patriot_1776
22-Sapphire II
(To:TomU)

Man, I'm sure glad there's very knowlegable coders like Tom here to help, because I s#ck at it!  🙂

This screams for the bound-function 😀

 

If ROD_LENGTH is the value you are "pushing", then the actual DIM_ROD_LENGTH can be defined as:

 

 

MY_MODEL = "A"
ROD_LENGTH = 45

IF MY_MODEL == "A"
   DIM_ROD_LENGTH = bound(ROD_LENGTH, 9.625, 53.125)
ENDIF

IF MY_MODEL == "B"
   DIM_ROD_LENGTH = bound(ROD_LENGTH, 10.125, 99.125)
ENDIF

 

 

It's much cleaner code 😎

 

About Functions Used in Relations 

Announcements
NEW Creo+ Topics: Real-time Collaboration


Top Tags