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

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Relations in a Template (sheetmetal) duplicated

mfontaine
1-Newbie

Relations in a Template (sheetmetal) duplicated

(disclaimer: i'm french and my english is not very good )

 

Hi, i had a weird problem with relations in my sheetmetal Template.

 

First i add a relations in my template to automaticly add the material in the description, It works well.

 

The problem is: sometimes a section ( the last "if/endif") of the relations duplicate at the end,so the relations dosen't work.

 

I can't found what is causing this, and it's appear randomly, i can create a bunch of new part and only one of those will have this problem.

 

 

I put this simplified version to show you the problem:

 

/*****************************************************************************************************************************************

/****************************** RELATION PAR DÉFAULT *************************************************************************

/*****************************************************************************************************************************************

/* The following relations make the bend allowance parameters    */

/* of part to be dependent on the assigned material, if the value  */

/* of the parameter SMT_UPDATE_BEND_ALLOW_INFO is YES.  */

/* If you remove or change these relations, the check box        */

/* 'Use assigned material to define the value of the bend        */

/*  allowance parameters' in the Bend Allowance category          */

/* in sheet metal Preferences dialog box might stop working.      */

if ( SMT_UPDATE_BEND_ALLOW_INFO == YES && exists("PTC_MATERIAL_NAME") )

  if ( string_length( material_param("BEND_TABLE") ) > 0 )

    SMT_PART_BEND_TABLE_NAME = material_param("BEND_TABLE")

  endif

  if ( material_param("INITIAL_BEND_Y_FACTOR") > 0.0 )

    SMT_PART_BEND_ALLOW_FACTOR_TYPE = "Y FACTOR"

    SMT_PART_BEND_ALLOWANCE_FACTOR = material_param("INITIAL_BEND_Y_FACTOR")

  endif

endif

SMT_DFLT_CRNR_REL_WIDTH = SMT_THICKNESS

SMT_DFLT_CRNR_REL_DEPTH = SMT_THICKNESS

SMT_DFLT_BEND_REL_WIDTH = SMT_THICKNESS

SMT_DFLT_BEND_REL_DEPTH = SMT_THICKNESS * 2.0

SMT_GAP = 0.01

SMT_DFLT_EDGE_TREA_WIDTH = -SMT_GAP

SMT_DFLT_MITER_CUT_WIDTH = SMT_GAP

SMT_DFLT_MITER_CUT_OFFSET = 0.01

SMT_DFLT_BEND_RADIUS = SMT_THICKNESS

SMT_DFLT_BEND_REL_DEPTH = SMT_THICKNESS  * 2.0

SMT_GAP = SMT_THICKNESS  * 0.5

SMT_DFLT_MITER_CUT_OFFSET = SMT_THICKNESS  * 1.1

 

 

/*****************************************************************************************************************************************

/****************************** RELATION DEMERS  *******************************************************************************

/*****************************************************************************************************************************************

NOM=REL_MODEL_NAME

 

 

/*************** RAYONS DE PLIAGE AUTOMATIQUE ***************

IF SMT_THICKNESS < 0.120

  SMT_DFLT_BEND_RADIUS= 0.040

  else

  SMT_DFLT_BEND_RADIUS=0.118

ENDIF

 

 

/*************** AJOUT DESCRIPTION DE MATÉRIEL AUTOMATIQUE ***************

IF AUTOMATIQUE_MATÉRIEL == YES

 

  /***** NON REPERTORIÉ *****

  DESC_MATERIEL =  "NON REPERTORIÉ"

  NO_REF = "-------"

 

 

  /********** ALUMINIUM **********

  /***** 0.032 *****

  IF SMT_THICKNESS == 0.032 & PTC_MATERIAL_NAME =="ALUMINIUM_IMPERIAL" & ANTIDERAPANT == NO

  DESC_MATERIEL =  'FEUILLE ALUMINIUM 5052-H32 20G (.032")'

  NO_REF = "E103054"

  ENDIF

 

 

  /********** ALUMINIUM ANTI-DÉREPANT **********

  /***** 0.063 *****

  IF SMT_THICKNESS == 0.063 & PTC_MATERIAL_NAME =="ALUMINIUM_IMPERIAL" & ANTIDERAPANT == YES

  DESC_MATERIEL =  'FEUILLE ALUMINIUM ANTIDÉRAPANT (.063"), MOTIF 102C'

  NO_REF = "E103072"

  SMT_DFLT_BEND_RADIUS=0.118

  ENDIF

 

 

 

 

  /********** ACIER INOXYDABLE**********

/***** 0.035 *****

  IF SMT_THICKNESS == 0.035 & PTC_MATERIAL_NAME =="ACIER_IMPERIAL"

  DESC_MATERIEL =  'FEUILLE ACIER INOX. 304 FINI #4 20G (.035")'

  NO_REF = "E102049"

  ENDIF

 

 

ENDIF

IF AUTOMATIQUE_MATÉRIEL == YES                                                    (AT THIS LINE THE LAST RELATION SECTION DUPLICATE)

  /***** NON REPERTORIÉ *****

  DESC_MATERIEL =  "NON REPERTORIÉ"

  NO_REF = "-------"

 

 

  /********** ALUMINIUM **********

  /***** 0.032 *****

  IF SMT_THICKNESS == 0.032 & PTC_MATERIAL_NAME =="ALUMINIUM_IMPERIAL" & ANTIDERAPANT == NO

  DESC_MATERIEL =  'FEUILLE ALUMINIUM 5052-H32 20G (.032")'

  NO_REF = "E103054"

  ENDIF

 

 

  /********** ALUMINIUM ANTI-DÉREPANT **********

  /***** 0.063 *****

  IF SMT_THICKNESS == 0.063 & PTC_MATERIAL_NAME =="ALUMINIUM_IMPERIAL" & ANTIDERAPANT == YES

  DESC_MATERIEL =  'FEUILLE ALUMINIUM ANTIDÉRAPANT (.063"), MOTIF 102C'

  NO_REF = "E103072"

  SMT_DFLT_BEND_RADIUS=0.118

  ENDIF

 

  /********** ACIER INOXYDABLE**********

  /***** 0.035 *****

  IF SMT_THICKNESS == 0.035 & PTC_MATERIAL_NAME =="ACIER_IMPERIAL"

  DESC_MATERIEL =  'FEUILLE ACIER INOX. 304 FINI #4 20G (.035")'

  NO_REF = "E102049"

  ENDIF

 

 

ENDIF


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
0 REPLIES 0
Top Tags