Loading...

Divide file name to two parameters

If your file name (model name, assembly name) is combined with DRAWING_NUMBER and MODEL_NAME separated by underscore “_” (254-33-03-008_wheel.prt) you can write relations for divide this file name to two parameters:

DRAWING_NUMBER = 254-33-03-008

MODEL_NAME = WHEEL

Write into Relations: Tools>Relations…

DRAWING_NUMBER=EXTRACT(REL_MODEL_NAME,1,SEARCH(EXTRACT(REL_MODEL_NAME,1,(STRING_LENGTH(REL_MODEL_NAME))),”_”)-1)

MODEL_NAME=EXTRACT(REL_MODEL_NAME,(SEARCH(REL_MODEL_NAME,”_”)+1),((STRING_LENGTH(REL_MODEL_NAME))-(SEARCH(REL_MODEL_NAME,”_”)+1)+1))

Transcript of real numbers to string

Do you need transform Real Number Parameter to String Parameter?

It is easy with Relations:

The input parameter: X=12.34567 (Real Number)

The output parameter: Y=1.234 (String)

Write into Relations: Tools>Relations…

/* Number of Digits
ND = 3

/* Rounded Number
RN = FLOOR((X+(5/10^(ND+1))),ND)

/* String Output – No Leading Zero
Y = ITOS(FLOOR(RN))+”.”+EXTRACT(ITOS((RN-FLOOR(RN)+1)*10^(ND)),2,ND)

* To get a zero before the decimal point for values less than one, a conditional statement is required:

/* String Output With Leading Zero

IF FLOOR(RN) == 0
Y = “0.”+EXTRACT(ITOS((RN-FLOOR(RN)+1)*10^(ND)),2,ND)
ELSE
Y = ITOS(FLOOR(RN))+”.”+EXTRACT(ITOS((RN-FLOOR(RN)+1)*10^(ND)),2,ND)
ENDIF

Automatic dividing of Pattern feature with Parameters

The input parameters:

SPACING (required hole spacing)
MINIMUM_OFFSET (minimum distance from the boundary)
LENGTH (total length)

The output parameters:

NUMBER_OF_MEMBERS (number of members in Pattern feature)
OFFSET (real offset from the boundary)

Write into Relations: Tools/Relations…

NUMBER_OF_MEMBERS=(floor(abs(LENGTH-(MINIMUM_OFFSET*2))/SPACING))+1
OFFSET=abs((LENGTH-((NUMBER_OF_MEMBERS-1)*SPACING))/2)

Trajpar parameter on pieces of your geometry

Quick example how you can manage trajpar parameter for a sweep feature in the Creo Parametric and Pro/ENGINEER

Set into relations for Sweep feature:

IF trajpar<=.05
sd3=45
ENDIF
IF trajpar>.05 & trajpar<.95
sd3=55
ENDIF
IF trajpar>=.95
sd3=45
ENDIF

About me

I am a highly successful, competent team member with extensive hands-on experience as an Application Engineer with Pre-sales consulting, implementing, troubleshooting and Post-sales consulting, configuration and setup of PTC products.