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

Feature selection in a relation

BenLoosli
22-Sapphire III

Feature selection in a relation

I have a family table that I am building of hex head screws. I want to put the material marking on the head and it varies depending on the nominal diameter of the screw. I have created the 2 markings and currently have them added to my family table so a Y or N will select the proper one. Since I have the diameter driving the head in an IF/ENDIF section in the relations, How do I add a feature inside the IF/ENDIF segment for each size.

Something like this:

IF basic =='1/2"

   nominal = .500

   hd_flat = .750

   hd_thk = .375

   fid:head_mark_c = yes

   fid:head_mark_d = no

ENDIF

Is that even possible in a relation or must I move some of this code to Pro/Program? I will probably leave the Y/N columns in the family table if I can't do it in relations.

Creo 2 M240

Windchill 10.0 M040

7 REPLIES 7

I have only seen conditional feature suppression done with Program.

TomU
23-Emerald II
(To:BenLoosli)

You could do this but you would still need to add a Pro/Program statement to suppress this feature based on the parameter value.  I'd suggest you keep the syntax simple and the model more understandable by having the parameter you are switching on and off (and using to drive Pro/Program) be a top level parameter instead of one buried inside the feature.

It's also a little cleaner (in my opinion) to pull the data down to the later feature from inside the later one vs. pushing it down from the earlier one.  This way if you decided to delete the later feature you don't have relations in the earlier feature that will fail.

Main_Feature

IF <blah> == <blah>

    HEAD_MARK = YES

ELSE

    HEAD_MARK = NO

ENDIF

Later_Feature

    MARK_TEXT = HEAD_MARK:FID_Main_Feature

Hi,

attached model is created in CR2 M070. See relations, pro/program.

MH


Martin Hanák
ggarcia
6-Contributor
(To:MartinHanak)

Hi Martin.

 

I saw your attached file

 

And I don't understand...

You create the parameters

Create the relations

But... How it supress the feature when change the dimension D4?

I not see the relation.

 

Thanks,

Gorka

KenFarley
20-Turquoise
(To:BenLoosli)

I had a need for this since we were using a variety of hex bolt grades, depending on location and function, as one does. I've got a lot of fastener family table parts where I use the geometric definition of the part to create the description that goes in the bill of materials, etc. It makes things very easy if I want to add another size bolt, I don't have to worry about this text stuff as long as I have the geometry right.

Anyway, to do the hex head cap screw grade markings, you'll notice that the standards call for the radial lines to be spaced a certain way, and start at a certain angle. They are all equally spaced, some completely around the bolt center, others for only a certain total angle. My method of doing them was:

(1) Define a first line, located at an angle from the corner.

(2) Pattern this line about the axis of the bolt with an angle and number of lines.

(3) Define a text parameter that specifies the grade of bolt.

(4) In the family table, add a column for the grade, and one for the pattern of lines.

(5) In the relations, assign the starting angle, pitch, and sizing of the lines based upon the bolt size and the grade.

The grade markings are turned on/off by the family table, and geometrically defined by relations. This works out well and it's nice to have the visual display of the bolt in the drawings show me that I've got the right grade of bolt defined for a particular location.

Here's my snippet of relations that do the marking definition:

---- [ Begin Relations ] ----

/*

/* The grade markings are defined based upon the geometric parameters and the grade designation.

/*

diagradeinner = 0.6 * diathread

diagradeouter = 0.9 * sizehex

IF gradedesignation != "<NONE>"

  IF gradedesignation == "5"

    anggradestart = 30.0

    numgrademarks = 3

    anggradeincrement = 120.0

  ENDIF

  IF gradedesignation == "5.1"

    anggradestart = 0.0

    numgrademarks = 3

    anggradeincrement = 90.0

  ENDIF

  IF gradedesignation == "5.2"

    anggradestart = 30.0

    numgrademarks = 3

    anggradeincrement = 60.0

  ENDIF

  IF ( gradedesignation == "7" )

    anggradestart = 45.0

    numgrademarks = 6

    anggradeincrement = 60.0

  ENDIF

  IF ( gradedesignation == "8" ) || ( gradedesignation == "BD" )

    anggradestart = 30.0

    numgrademarks = 6

    anggradeincrement = 60.0

  ENDIF

ENDIF

---- [ End Relations ] ----

Hope this is helpful.

vzak
5-Regular Member
(To:BenLoosli)

Did you try simply putting "ADD FEATURE .... " section of already created feature under condition (this is not in relation section, this is inside ProPROGRAM where feature actually resides) ? Like :

IF ABC = ***

  ADD FEATURE PROTRUSION ID 275

  ..............................

  END ADD

END IF

 

in case you have 2 alternate features put them both under alternate conditions, no need to suppress if I am not mistaking.

 

Regards

- Vlad

bono_castenedol
5-Regular Member
(To:vzak)

is possible using proprogram suppres or delete a member of pattern?

I have a parameter that defines the number of the member, the problem is that in some cases it is 1 and the series fails.

 

is it possible with proprogram to achieve this result without causing a failure?

 

 

 

Announcements