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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Locked Parameter driven by relations

joe_c
12-Amethyst

Locked Parameter driven by relations

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 15
dschenken
21-Topaz I
(To:joe_c)

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

joe_c
12-Amethyst
(To:dschenken)

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

dschenken
21-Topaz I
(To:joe_c)

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?

joe_c
12-Amethyst
(To:dschenken)

Thanks.. I was very clearly at the beginning. How to increase the nomenclature length?  I thought NB characters played a role. I guess my only option is to create a separate parameter to fill in the rest of the nomenclature

CoJito
1-Newbie
(To:joe_c)

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_c
12-Amethyst
(To:CoJito)

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

MartinHanak
24-Ruby II
(To:joe_c)

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


Martin Hanák
pperrin
1-Newbie
(To:joe_c)

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

llie
16-Pearl
(To:pperrin)

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_c
12-Amethyst
(To:llie)

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

llie
16-Pearl
(To:joe_c)

Is the only reason to control the number of characters per line is so the text does not go outside the box? These is where PTC stepped up and implemented the Word wrap functionality to their tables, just like in excel.

The  + sign is used to add the three parameters together.

Title1: THIS

Title2: IS A

Title3: TEST

Title:  THIS IS A TEST

We add &TITLE to the Title cell, both vertical and horizontal center justified. Whether it is one line, two lines, or three lines it is always centered.

2016-11-14_11-35-59.jpg

dschenken
21-Topaz I
(To:llie)

Unless it changed, Creo 3 word wrap did not handle the space character correctly for center justified text; in Excel it will not include space characters in the width calculation for determining where the center of the visible text is.

In Creo 3 it makes each line shift 1/2 the space character width to the left of where it should be if it was handled by usual typographic rules.

llie
16-Pearl
(To:dschenken)

That being true, it still eliminates the need for customization and use the technology to our advantage. We are also looking to implement another part/assembly relation that eliminates the one I posted earlier, TITLE=TITLE1+" "+TITLE2+" "+TITLE3.

The new one is:TITLE = PTC_COMMON_NAME

This would eliminate the manual input of the same information into two different areas and also human input error especially when Windchill likes to add a space at the end of the copy/paste function.

The user would only have to input the information in Windchill. Currently they fill out the Creo file parameters and also Windchill attributes.

psobejko
12-Amethyst
(To:llie)

Any reason you don't just display the PTC_COMMON_NAME parameter directly ?  Why assign it to an intermediate parameter?

See Windchill "Name" becomes same as filename / number - any way around that?

llie
16-Pearl
(To:psobejko)

The reason is that engineers, designers, drafter, checkers, CM, and everyone else that has touched a ProEngineer/Creo drawing is used to Title. They file in the Creo part/asm parameters (TITLE1, TITLE2, TITLE3) which drives the parameter Title that is used in the Title Block and the BOM. Users do not know what PTC_COMMON_NAME is and it would just confuse them.

We are still converting other small locations to Windchill. I think after all business are on Windchill for a couple years and everything gets created in the Workspace, then we could make the switch.

Top Tags