1Today's goals
- Show dimension symbols (d0, d1…) and rename them
- Add model parameters (real, integer, string, yes/no)
- Write relations: equations, functions, IF … ELSE … ENDIF, comments
- Drive pattern counts and suppress features with relations
- Know part, assembly and section relations and their order
2Parameters and relations
Dimension symbolsEvery dimension has a symbol (d0, d1…). Tools ▸ Switch Dimensions shows them. Rename a dimension in its Properties to
OD so relations read like English.ParametersTools ▸ Parameters. Your own named values: MATERIAL_GRADE (string), N_BOLTS (integer), HAS_KEYWAY (yes/no), MASS_LIMIT (real). They also fill drawing title blocks and BOMs.
RelationsTools ▸ d= Relations. Equations that run in order every regeneration:
PCD = OD - 40. The left side is driven — you cannot type it on screen any more.Functionssqrt, abs, floor, ceil, min, max, sin/cos/tan in degrees, pi, IF … ELSE … ENDIF, comparisons == <> < > & |. Comments start with
/*.Order. Relations run top to bottom; a parameter must be given a value before a line uses it. Part relations run during regeneration; you can also choose to run some after regeneration (for mass, using the Post Regeneration list) or put relations in a feature or a sketch (sd symbols).
Pattern counts are dimensions too: in relations they look like P12. Example: P12 = floor(LENGTH / 40) + 1.
3Do it in Creo
- Model a flange: revolve OD 160 × 12 thick, bore Ø80, one Ø11 hole at Diameter placement PCD 120, axis-patterned 6.
- Tools ▸ Switch Dimensions. Select each dimension ▸ Properties ▸ Name:
OD,THK,BORE,PCD,BOLT_D. The pattern count shows as P#. - Tools ▸ Parameters ▸ add
N(Integer) = 6. - Tools ▸ d= Relations, type:
/* flange rulesPCD = OD - 40BORE = OD / 2P15 = N(use your pattern's symbol)IF N > 8BOLT_D = 9ENDIF - Click Verify (the check button) then OK. Regenerate.
- Change OD to 200 and N to 10 from the Parameters dialog or by editing OD on screen. Regenerate: PCD, bore, bolt size and count follow.
- Try to edit PCD on screen — Creo says it is driven by a relation.
- Add a string parameter
DESCRIPTION= "Flange OD" + a relationDESCRIPTION = "FLANGE OD" + itos(OD)(itos = integer to string).
4Lab: live relations editor
Edit the relations below — Creo-style syntax, IF/ENDIF, functions in degrees. The flange redraws as you type and warns when holes break out or overlap.
5Pro tips and common mistakes
- Name dimensions before writing relations.
d17 = d4 - 40is unreadable in six months. - Do not drive the same dimension from two places (a relation and a family table) — the last one wins and nobody knows which.
- Trig functions use degrees:
sin(30) = 0.5. - Use
/*comments to say why, not what. - To switch whole features on and off by rule, use a family-table feature column (Day 13) or Pro/PROGRAM (Tools ▸ Program), where an IF … END IF around a feature's ADD … END ADD block includes or skips it.
- Assembly relations can drive part dimensions:
OD:3 = BORE:5 + 2(the :n is the component session ID).
6Practice
- Model a shaft whose step diameters follow one parameter D:
D2 = D + 5,D3 = D + 10, keyway width from a lookup with IF (D ≤ 22 → 6, ≤ 30 → 8, else 10). - A cable tray: length L drives the count of slots,
P = floor((L - 40)/50) + 1, slots always centred. - Add a real parameter MASS_KG and fill it after regeneration from the mass property (Post Regeneration relation
MASS_KG = mp_mass("")).
7Quick quiz
Five questions. Click an answer — you get the explanation straight away.