Skip to main content
14-Alexandrite
November 10, 2016
Question

Locked Parameter driven by relations

  • November 10, 2016
  • 15 replies
  • 6470 views

Please help


I need to increase the nomenclature length which is driven by this relation (End if statement).  If NB_2=65, The maximum nomenclature_length will be 80.  If NB_2>65. An error occurs. Thanks


/*  RELATION TO CUT NOMENCLATURE INTO 3 PARTS TO FIT IN DRAWING BLOCK

/*

/* NB_1 IS THE NUMBER OF CHARACTERS TO BREAK NOMENCLATURE AT FIRST POINT

/* NB_2 IS THE NUMBER OF CHARACTERS TO BREAK NOMENCLATURE AT SECOND POINT

NB_1=28

NB_2=57

/*

/*

NOMENCLATURE_1=NOMENCLATURE

NOMENCLATURE_2=""

NOMENCLATURE_3=""

NOMENCLATURE_LENGTH=STRING_LENGTH(NOMENCLATURE)

IF NOMENCLATURE_LENGTH > NB_1 & NOMENCLATURE_LENGTH <= NB_2

   NOMENCLATURE_1 = EXTRACT(NOMENCLATURE,1,NB_1)

   NOMENCLATURE_2 = EXTRACT(NOMENCLATURE,NB_1+1,NOMENCLATURE_LENGTH-NB_1)

ENDIF

IF NOMENCLATURE_LENGTH > NB_2

   NOMENCLATURE_1 = EXTRACT(NOMENCLATURE,1,NB_1)

   NOMENCLATURE_2 = EXTRACT(NOMENCLATURE,NB_1+1,NB_2-NB_1)

   NOMENCLATURE_3 = EXTRACT(NOMENCLATURE,NB_2+1,(NOMENCLATURE_LENGTH-NB_2))

ENDIF

drw-block.PNG


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.

15 replies

1-Visitor
November 11, 2016

What is the maximum NB_2 when the parameter length is 79?

joe_c14-AlexandriteAuthor
14-Alexandrite
November 11, 2016

If NB_2, the nomenclature_length is still 80.  It doesnt change

1-Visitor
November 11, 2016

I think you asked the wrong question - you want the nomenclature string parameter to have more than 80 characters - As Martin points out, 80 is the maximum number of characters allowed. This answer has nothing to do with the original question concerning the value of NB_2.

For the original question:

Your problem statement:

If NB_2 = 65 then no error for parameter length up to 80

If NB_2 > 65 then some error for parameter length = 80

Test question:

If parameter_length =79 what is the maximum NB_2 for which there is no error?

1-Visitor
November 11, 2016

Try this.

/*NOMENCLATURE="1111111111222222222233333333334444444444" + \
                          "5555555555666666666677777"  /*777778888888888"

/*  RELATION TO CUT NOMENCLATURE INTO 3 PARTS TO FIT IN DRAWING BLOCK

/*

/* NB_1 IS THE NUMBER OF CHARACTERS TO BREAK NOMENCLATURE AT FIRST POINT

/* NB_2 IS THE NUMBER OF CHARACTERS TO BREAK NOMENCLATURE AT SECOND POINT

NB_1=28
NB_2=65

/*

/*

NOMENCLATURE_1=NOMENCLATURE

NOMENCLATURE_2=""

NOMENCLATURE_3=""

NOMENCLATURE_LENGTH=STRING_LENGTH(NOMENCLATURE)

NB_1=IF(NB_1>=NOMENCLATURE_LENGTH,0,NB_1)
NB_2=IF(NB_2>=NOMENCLATURE_LENGTH,0,NB_2)

IF NB_1>0 & NB_2==0
   NOMENCLATURE_1 = EXTRACT(NOMENCLATURE,1,NB_1)
   NOMENCLATURE_2 = EXTRACT(NOMENCLATURE,NB_1+1,NOMENCLATURE_LENGTH-NB_1)
ENDIF

IF NB_1>0 & NB_2>0
   NOMENCLATURE_1 = EXTRACT(NOMENCLATURE,1,NB_1)
   NOMENCLATURE_2 = EXTRACT(NOMENCLATURE,NB_1+1,NB_2-NB_1)
   NOMENCLATURE_3 = EXTRACT(NOMENCLATURE,NB_2+1,(NOMENCLATURE_LENGTH-NB_2))
ENDIF

joe_c14-AlexandriteAuthor
14-Alexandrite
November 11, 2016

Hi Andreas

Thanks. Try it but it doesnt seem to change the nomenclature_length. It is set to 80 no matter what i do.. Frustrating indeed

length.PNG

24-Ruby III
November 11, 2016

Hi,

maximum length of string parametr value is 80.

My relations follow...

/*  RELATION TO CUT NOMENCLATURE INTO 3 PARTS TO FIT IN DRAWING BLOCK

/*

/* NB_1 IS THE NUMBER OF CHARACTERS TO BREAK NOMENCLATURE AT FIRST POINT

/* NB_2 IS THE NUMBER OF CHARACTERS TO BREAK NOMENCLATURE AT SECOND POINT

NB_1=28

NB_2=57

/*

/*

NOMENCLATURE_1=NOMENCLATURE

NOMENCLATURE_2=""

NOMENCLATURE_3=""

NOMENCLATURE_LENGTH=STRING_LENGTH(NOMENCLATURE)

IF NOMENCLATURE_LENGTH > NB_1

   NOMENCLATURE_1 = EXTRACT(NOMENCLATURE,1,NB_1)

   NOMENCLATURE_2 = EXTRACT(NOMENCLATURE,NB_1+1,NOMENCLATURE_LENGTH-NB_1)

   IF NOMENCLATURE_LENGTH > NB_2

      NOMENCLATURE_2 = EXTRACT(NOMENCLATURE,NB_1+1,NB_2-NB_1)

      NOMENCLATURE_3 = EXTRACT(NOMENCLATURE,NB_2+1,NOMENCLATURE_LENGTH-NB_2)

   ENDIF

ENDIF

MH

1-Visitor
November 14, 2016

Hi Joseph,

I've no problem with the relation you created.

The only limitation is that the NOMENCLATURE lenght can't be more than 80 characters (as said by Martin).

NOMENCLATURE = "12345678911234567892123456789312345678941234567895123456789612345678971234567890"  80 chars

NB_1=35

NB_2=70

What is the error you encountered ?

Pierre

17-Peridot
November 14, 2016

Joseph,

Since we went to Creo 3 we are looking into removing the three parameter lines from our title block all together and use Word Wrap in the cell with only one parameter, TITLE. This way you do not have to worry about the length of each line running out side the box. We have the following in our start parts:

Relation:

TITLE=TITLE1+" "+TITLE2+" "+TITLE3

Parameters:

TITLE1

TITLE2

TITLE3

We have all ready proved it out and currently testing on a test PDM server.

joe_c14-AlexandriteAuthor
14-Alexandrite
November 14, 2016

That looks simpler but can you control the number of characters per line.  What does the + sign do again?