Program > An Example of Parametric Design > Example: A Parametric Design for a Blender Cover
  
Example: A Parametric Design for a Blender Cover
This example illustrates the logic of the design and the usage of INPUT, EXECUTE, and IF-ELSE statements. The format of the ADD FEATURE statements in the part design has been simplified. The explanations in square brackets are for information only and do not appear in a normal listing.
Creating a Parametric Design
1. Assembly 1
2. Assembly 2
3. Assembly 3
4. COVER_TYPE=NO
5. CYL_DIAM
6. CAP: MODEL_A
7. COVER_TYPE=YES
8. COVER_SIZE
9. CAP: MODEL_B
Design for Assembly BLENDER
The parametric design for the assembly BLENDER follows:
INPUT
COVER_TYPE YES_NO
"Does the cover have a cap?:"
MATERIAL
STRING
"Enter material (ABS or Poly):"
CAP_TYPE
STRING
"Enter cap type (MODEL_A or MODEL_B):"
COVER_SIZE
"Enter the top plate dimension:"
END INPUT
RELATIONS
END RELATIONS

EXECUTE PART COVER [a.]
COVER_TYPE = COVER_TYPE
COVER_SIZE = COVER_SIZE
MATERIAL = MATERIAL
END EXECUTE

ADD PART COVER [b.]
INTERNAL MEMBER ID 2
...
END ADD

IF COVER_TYPE == YES [c.]
ADD PART (CAP_TYPE)
INTERNAL MEMBER ID 3
...
END ADD
END IF
 
* a. Pass value for COVER_TYPE down to part "Cover." If value is YES, cover has a hole added. Also, pass values for material and size of the cover (size of the top plate).
* b. Add a cover.
* c. If COVER_TYPE=YES, add the cap to the assembly.
Design for Part COVER
The parametric design file for the part COVER follows:
INPUT
COVER_TYPE YES_NO
COVER_SIZE
MATERIAL STRING
END INPUT

RELATIONS
DIAM = COVER_SIZE / 2 [a.]
IF MATERIAL == "Poly"
d0=.10
ELSE
d0=.2
ENDIF
END RELATIONS


ADD FEATURE 1
INTERNAL FEATURE ID 33 [b.]
TYPE=FIRST FEATURE
...
COVER_SIZE = 2.4 [c.]

ADD
END

ADD FEATURE [d.]
INTERNAL FEATURE ID 169
TYPE=PROTRUSION
...
END ADD

IF COVER_TYPE == YES [e.]
ADD FEATURE 3
INTERNAL FEATURE ID 270
TYPE=SLOT
...
END ADD
END IF
 
* a. Relations include a relation for the hole diameter and a conditional statement for material type. ("Poly" and "ABS" require double quotation marks.)
* b. Add the base feature.
* c. Parameter name has been renamed to "COVER_SIZE".
* d. Add walls.
* e. If COVER_TYPE=YES, add a hole. (No quotation marks around YES.)
Design for Part CAP
The part CAP is table driven with instances MODEL_A and MODEL_B. The parametric design file for the part CAP follows:
INPUT
END INPUT

RELATIONS
END RELATIONS

ADD FEATURE 1 [Add the base feature of the cap.]
INTERNAL FEATURE ID 33
TYPE=FIRST FEATURE
...
END ADD

ADD FEATURE [Add a datum plane.]
INTERNAL FEATURE ID 106
TYPE=DATUM PLANE
...
END ADD

ADD FEATURE [Add a protrusion.]
INTERNAL FEATURE ID 108
TYPE=PROTRUSION
...
END ADD

ADD FEATURE [Add a hole.]
INTERNAL FEATURE ID 179
TYPE=HOLE
...
END ADD

ADD FEATURE [Add a top plate.]
INTERNAL FEATURE ID 198
TYPE=PROTRUSION
END ADD