Available in TurboCAD Pro and Platinum only
Parametric parts (PPM) are defined using a text description (script). The script defines the structure, editable properties, and output that result in a parametrically editable part.
The script must be saved with a *.PPM extension. The name of the file determines the name of the part.
...
Panel |
---|
NOTE: The '<>' markers are used to designate elements in the expression, and the '[ ]' markers are used to indicate elements which are optional. |
<name> | The name displayed in the user interface; |
<default value> | The default value of the parameter; |
<type> | Defines the parameter type. The following example values are possible: |
<condition> | These are optional. They define possible restrictions imposed on parameters. Restrictions can be listed in arbitrary order and may take on the following forms: |
Example of Parameter Description:
...
Format:
Circle(<radius>[, <cx>, <cy>]);
<radius> | Defines the circle's radius |
<cx>, <cy> | Defines optional arguments that set the (x, y) coordinates of the circle center. By default, cx = 0, cy = 0 |
Example:
N = Circle(D/2, 0, y0);
...
Format:
Rectangle(<width>, <height>[, <cx>, <cy>]);
<width> | Defines the rectangle width |
<height> | Defines the rectangle height |
<cx>, <cy> | Defines optional arguments that set the (x, y) coordinates of the rectangle center. By default, cx = 0, cy = 0 |
Example:
rect = Rectangle(W, H, W/2. H/2); // Left bottom corner is in (0,0) point
...
Format:
Polyline(<list of arguments>);
<list of arguments> | Defines the list of arguments, delimited with commas. Arguments define individual segments of a polyline |
A line segment is defined by 2 Points.
An arc segment is defined with a Fillet function or with an Arc0 or Arc1 function and two Points on the ends of the arc.
For polylines that contain only straight line segments, the <list of arguments> consists of only 2D points, defined using Point(x,y) function.
Format:
Point(<cx>,<cy>)
<cx> | Defines the x coordinates of the point |
<cy> | Defines the y coordinates of the point |
For example, a rectangle can be defined in the following way:
...
Format:
Arc0(<cx>,<cy>),
Arc1(<cx>,<cy>),
<cx> | Defines the x coordinates of the arc center |
<cy> | Defines the y coordinates of the arc center |
The start and end point of an arc are defined by the preceding and the following arguments.
Arc0 and Arc1 cannot be the first or last argument in the list of arguments. For a polyline that contains only one arc segment, the <list of arguments> consists of 2 Points defined with Point(x,y) function and an arc defined with either the Arc0 or Arc1 function.
...
Another method of creating an arc in a polyline is to use the auxiliary function Fillet, which "smooths" two linear segments that start and end in the preceding point, by adding an arc with the specified radius into the corner. This ensures smoothness at the junction points.
Format:
Fillet(<radius>);
<radius> | Defines the radius of the fillet |
Example of fillets in a polyline:
...
Format:
Thickness(<Object>, <value>);
<Object> | Defines the initial graphic object |
<value> | Defines new value of Thickness |
Example of Thickness:
RectA = Rectangle(2, 5);
RectThick = Thickness(RectA, 3);
...
Format:
Sweep(<profile>, <path>[,<rotation angle>]);
<profile> | This defines the profile using a 2D polyline |
<path> | This defines the path, along which the profile is "dragged"; the path is defined by a 2D polyline |
<rotation angle> | This optional argument, defines the rotation angle of the profile relative the Z axis; by default, the argument is equal to zero |
Example of Sweep:
Poly1 = Polyline(
Point(0,0),
Point(1, 0),
Point(1,2),
Point(0, 2),
Point(0,0) );
PolyProfile = RotateX(Poly1, 90); // the Rotate function will be explained later
PolyPath = Polyline(
Point(0,0),
Point(10, 0),
Point(10,10),
Point(0, 10),
Point(0,0) );
PolySweep = Sweep(PolyProfile, PolyPath);
Output(PolySweep);
...
Format:
Sphere(<radius>[,<cx1>,<cy1>,<cz1>]);
<radius> | This value specifies the radius of the sphere |
<cx1>,<cy1>,<cz1> | These are optional argument used to specify the x, y, z location of the sphere's center point. By default the values for these argument is zero |
Sphere Example:
SR1 = Sphere(10,1,3,5.5);
...
Format:
Cone(<Height>,<baseradius>[,<topradius>]);
<Height> | This value specifies the height of the cone |
<baseradius> | This value specifies the radius for the base of the cone |
<topradius> | This optional argument specifies a radius for the top of the cone, creating a truncated cone. By default the value for this argument is zero |
Cone Example:
CN1 = Cone(10,5,2);
...
Format:
Move(<Object>, <dx>, <dy> , <dz>[,count]);
<Object> | Defines the original graphic object |
<dx>, <dy>, <dz> | Defines value of movement along x, y and z axes, respectively |
<count> | Defines the number of created objects, where each subsequent object is created by moving the preceding object; this argument is optional, with the default value of 1 |
Example of Move:
PolyProfile = Move(Poly1, 1, 3);
...
Format:
RotateX(<Object>, <rotation angle>[, <cy>, <cz>[,<count>]]);
RotateY(<Object>, <rotation angle>[, <cx>, <cz>[, <count>]]);
RotateZ(<Object>, <rotation angle>[, <cx>, <cy>[, <count>]]);
<Object> | Defines the original graphic object |
<Rotation angle> | Defines the angle of rotation |
<cx>, <cy>, <cz> | Sets an offset for the rotation axis relative to the X, Y and Z axes (in accordance with function names). These arguments are optional; however, only all three arguments can be omitted at once. Default value for each of <cx>, <cy>, <cz> is zero |
<count> | Defines the number of created objects, where each subsequent object is created by transforming the preceding object; this argument is optional, with the default value of 1 |
Example of Rotate:
PolyProfile = RotateX(Poly1, 90);
...
Format:
StaticSymbol(<FileName>[,BlockName]);
<FileName> | Defines the file name with extension. If the extension is not specified, native file format will be used |
<BlockName> | This is an optional argument, which indicates that only the block with the given name should be used as the symbol for loading, and the rest of the contents should be ignored; if the argument is not defined, the active drawing will be loaded as a symbol |
Example of StaticSymbol:
//staticsym1.ppm – loads an external file from the Macro sub-folder
S = StaticSymbol("ExternalSymbol.tcw");
Output(S); //static symbol from ExternalSymbol.tcw file is inserted on the drawing
...
Format:
<id> = FolderList(<path> <mask> = "*.ppm");
<path> | Defines the path to the folder from which the list of files will be created |
<mask> | Defines the mask of file names and extensions |
Example of Set(FolderList(..)):
...
Format:
BooleanUnion(<Object>, <Object>, ...);
<Object> | Defines an object to be used in the Boolean operation. There must be at least two objects |
Example of BooleanUnion:
S1 = Sphere(5);
S2 = Sphere(5,5,5);
S3 = Sphere(5,5,-5);
S4 = Sphere(5,-5,5);
S5 = Sphere(5,-5,-5);
S6 = BooleanUnion(S1,S2,S3,S4,S5);
Output(S6);
...
Format:
BooleanSubtract(<PrimaryObject>, <SecondaryObject>, ...);
<PrimaryObject> | Defines an object to be used in the Boolean operation. There is only one primary object |
<SecondaryObject> | Defines a secondary object to be subtracted from the primary object There must be at least one or more secondary objects |
Example of BooleanSubtract:
...
Format:
BooleanIntersect(<Object>, <Object>)
<Object> | Defines an object to be used in the Boolean operation. There must only two objects |
Example of BooleanIntersect:
...
Format:
G3Fillet(<Object>,<Edges>, <Radii>);
<Object> | Defines the 3D object whose edges are to be rounded |
<Edges> | Defines the edge or multiple edges, which are to be filleted. Each edge is defined by Point(xc,yc,zc) or Array of Points. |
<Radiuses> | Defines the Fillet radiuses. Fillet radiuses are set by Array function. For a single edge the Array contains pair of values, for multiple edges - multiple pairs of values. |
Fillet Edges Example:
Array(Point(x1,y1,z1), Point(x2,y2,z2), Point(x3,y3,z3)); //defines 3 edges for filleting
//Point(x1,y1,z1), Point(x2,y2,z2), Point(x3,y3,z3); – 3 middle points on 3 edges to be filleted
...
Format:
G3Chamfer(<Object>, <Edges>, <Offsets>);
<Object> | Defines the 3D object whose edges are to be chamfered |
<Edges> | Defines the edge or multiple edges, which are to be filleted. Each edge is defined by Point(xc,yc,zc) or Array of Points. |
<Radiuses> | Defines the Chamfer distances. These are set by Array function. For a single edge the Array contains a pair of distance values, for multiple edges - multiple pairs of distance values. |
A Chamfer Example:
Array(d1, d2)-- //array of 2 offset values at the ends of an edge.
...
Format:
G3Offset(<Object>, <Face>, <Offsets>);
<Object> | Defines the 3D object whose edges are to be extended |
<Face> | Defines the face, which is to be extended. The Face is defined by a Point(x,y,z) belonging to this face |
<Offsets> | Defines the offset distance. A positive value will offset the face outward, and a negative value will offset inward |
Offset Example:
G3Offset(PartA, Point(xf, yf, zf), dist);
Where:
PartA — is the 3D object whose faces are to be offset
Point(xf, yf, zf) — is a point for selecting the face to be offset
dist — is the value of face offset
...
Format:
G3Shell(<Object>, <Face>, <Thickness>);
<Object> | Defines the 3D object whose edges are to be shelled |
<Face> | Defines the face that should remain open. It is defined by the Point(xc,yc,zc) function which describes a point belonging to this face |
<Thickness> | Defines the shell thickness. A positive value creates an outward shell, and a negative value creates an inward shell |
Shell Example:
G3Shell(PartA, Point(xf, yf, zf), thickn);
Where:
Part3 — selects the object which is to be shelled
Point(xf, yf, zf) — is the point on the face, which should remain open
thickn — is the shell thickness
...
Format:
G3Bend(<Object>, <Line>, <Angle>, <Radius>, <Depth> );
<Object> | Defines the 3D object which is to be bent |
<Line> | Defines a line about which the solid object will be bent. It is defined by 2 Points: |
<Angle> | Defines the bending angle. The angle is measured from the plane of the bent face. |
<Radius> | Defines the bending radius |
<Depth> | Defines the Neutral Depth to set the distance into the depth of material along which there will be no tension or compression |
Bend Example:
G3Bend(Part3, Point(x1, y1, z1), Point(x2, y2, z2), Angle, R, 0);
...
Format:
SetProperties(<Object>, <PropertyName> = PropertyValue, <PropertyName> = PropertyValue, ...);
<Object> | Defines the object to be used as the base for the new object with set properties |
<PropertyName> | Defines the name of the property to be set. The name should be surrounded with quotation marks |
<PropertyValue> | Defines the value to be assigned to the property |
Example of SetProperties:
...
Format:
Text(<Text object>, <Text Font>, <Text Style>);
<Text object> | Defines the text string. Text string can be specified either directly here (with quotation marks) or via an identifier of text object |
<Text Font> | Defines the text font |
<Text Style> | Defines the text style |
Example:
bsb = Text("BS(b)", Tfont, Tstyle);
...
Format:
TextFont(<mode>, <Height>, <Angle>, <font>);
<mode> | Defines the mode of the text: Standard (when mode=0) or Scalable (when mode=1 or any other value different from 0) |
<Height> | Defines the text font size |
<Angle> | Defines the angle of text line |
<font> | Defines the text font |
Example:
Tfont = TextFont(0,2, 45, "Arial");
...
Format:
TextStyle(<list of characteristics>);
<list of characteristics> | Defines the text characteristics separated with commas. |
Example:
Tstyle = TextStyle(LEFT, TOP, UNDERLINE);
...
ExtentsX1(<Object>);
ExtentsX2(<Object>);
ExtentsY1(<Object>);
ExtentsY2(<Object>);
ExtentsZ1(<Object>);
ExtentsZ2(<Object>);
<Object> | Defines the object to be used |
The presence of X, Y or Z characters in the function name determines axis along which the extents will be calculated.
1 or 2 index--indicates whether minimum or maximum value should be calculated.
...
Format:
ParameterPoint (<N>,<xc>,<yc>,<zc>);
<N> | Defines the number of the parametric point |
<xc>,<yc>,<zc> | Defines the coordinates of parametric point |
Example of ParameterPoint:
...
Format:
PointX (<point>);
PointY(<point>);.
PointZ(<point>);
<point> | Defines the parametrical point from which the X or Y or Z coordinate will be extracted |
Examples of Point:
x0 = PointX(P0); // x0=1 for P0 = ParameterPoint(0, l, -l, 0);
y1 = PointY(P1); //y1=0 for P1 = ParameterPoint(1, 0, 0, 0);
z1 = PointZ(P1); //z1=0 for P1 = ParameterPoint(1, 0, 0);
Anchor | ||||
---|---|---|---|---|
|
...
Format:
IF(<Condition>, <ExprOnTRUE>, <ExprOnFALSE>);
<Condition> | Defines the condition under test using the following comparison operations: |
<ExprOnTRUE> | Defines the value of the IF function when the value of <Condition> is TRUE; |
<ExprOnFALSE> | Defines the value of the IF function when the value of <Condition> is FALSE; |
IF Example:
A = IF(L >= H, Rectangle(L, H), Rectangle(H, L));
//Regardless of the specified size of L and H, the created rectangle A will be positioned //horizontally (the longer side will be along the X axis).
/* In this example "Rectangle(L, H)" is the TRUE result and "Rectangle(H, L" is the FALSE result. */
...
Format:
Units(<N>[<units of dimension>]);
<N> | Defines object scale |
<units of dimension> | Defines the units in the English or Metric systems |
Units (1[in]) — this means that the main units of measurement are inches. It is possible to use other units for some particular values even when the entire drawing is created with the default unit. In order to use millimeters for particular values while inches are default units, you can explicity declare the desired unit for these values.
...
Format:
RefPoint(<Point>);
<Point> | Defines the (x,y,z) coordinates for location of Reference Point |
For Example:
xArrow = PointX(P0);
yArrow = PointY(P0);
rf = RefPoint(xArrow, yArrow, 0); //-> RefPoint is placed on the point (xArrow,yArrow, 0)
Output(rf);
...
Format:
Input(<list of variable identifiers, separated with commas>);
Output(<list of variable identifiers, separated with commas>);
<list of variable identifiers, separated with commas> | Defines the list of variables or objects for input or a list of results for output |
For Example:
Input(H, W, D, A, Dis);
Output(SideA_L,Bottom_B,Back_I, Face1, FalseD1, E1,E2,E3,E4, N1, T1, Door, FF,
SideA_R);
...
Format:
min(<set of values>);
max(<set of values>);
<set of values> | Defines the set of numerical values, identifiers of variables or Array of variables |
For Example:
r=min(2,5,1,7,9);//r=1
R=max(2,5,1,7,9);//R=9
...
Format:
Mod(<value1, value2>);
<value1 > | Defines the expression or identifier that represents the dividend |
<value2> | Defines the expression or identifier that represents the divisor |
For Example:
A = 7;
B = 4;
C = Rectangle(A, Mod(A,B));
Output(C);
...
Format:
Div(<value1>,<value2>);
<value1> | Defines the dividend |
<value2> | Defines the divisor |
For Example:
A=7;
B=3;
result1 = A/B;
result2 = Div(A, B);
rect = Rectangle(result1, result2)
Output(rect);
...
Format:
Array(<list of objects>)
<list of objects> | list of numerical values or geometric objects |
For Example:
Array(Point(L/2, 0, 0), Point(0, W/2, 0), Point(L/2, W, 0), Point(L, W/2, 0))
// It is the array of points defining the edges for G3Fillet.
Array(R, R, R, R, R, R, R, R)
//It is the array of radius values for filleting the array of edges.
...
Format:
Group (<list of objects>);
<list of objects> | Defines the list of graphic objects, separated with commas. The <object> may be any graphic objects |
For Example:
bse = Group(bse_below, bse_above); //group of 2 graphic objects
Br2 = Group(Br0, Br1);
...
Parametric Parts Reserved Word List
PI | LINEAR | TEXT |
ANGULAR | MATERIAL | FONT |
COLOR | CHECKBOX | ITALIC |
BOLD | UNDERLINE | BOX |
ALLCAPS | STRICKETHROUGH | TOP |
MIDDLE | BOTTOM | BASELINE |
LEFT | CENTER | RIGHT |
Call | Array | + |
- | * | Div |
Mod | / | - |
sin | cos | tan |
atan | min | max |
** | = | == |
!= | < | > |
<= | >= | & |
Solid | Extrude | |
UNIQUE | GraphicId | VertexId |
Vertex | Face | |
Edge | Source | Bound |
Intersect | OperationList | BlendArg |
BlendParam | BlendType | BlendRadiusMode |
BlendSetback | BlendRadiusBlendSmooth | BlendRadiusParam |
BlendOffsetParam | BlendFaceEntity | BlendFaceEdge |
BlendFaceVertex | BlendEdgeEdge | BlendEdgeVertex |
BlendEdgeVertexMain | BlendEdgeVertexAux | ShellArg |
ShellThickness | ShellFace | ShellEdge |
FaceEditArg | Transform | ScaleX |
ScaleY | ScaleZ | ShearXY |
ShearXZ | ShearYZ | RotateX |
RotateY | RotateZ | TranslateX |
TranslateY | TranslateZ | Path |
Profile | LateralFace | LateralEdge |
CapFace | CapEdge | JointEdge |
Profiles | HighLight | FaceMaterialArg |
FaceMaterial | FaceOffsetArg | FaceHoleArg |
FaceHole | BendId | BendRadius |
BendAngle | BendNeutral | BendFlag |
BendPosition | BendFlangeHeight | BendAxialDistance |
BendAzimuthAngle | BendEdgeStartPosition | BendEdgeEndPosition |
Face2FaceLoftArg | Face2FaceLoft | |
AssemblyAxis | Input | Output |
Include | Units | StaticSymbol |
FolderList | Macro | Parameters |
Parameter | ParameterPoint | PointX |
PointY | PointZ | Set |
Interval | LessThan | GreaterThan |
LessOrEquail | GreaterOrEqual | Circle |
Rectangle | Polyline | Point |
Arc0 | Arc1 | Fillet |
IF | Move | Thickness |
Sweep | Cone | BooleanUnion |
BooleanSubtract | BooleanIntersect | G3Fillet |
G3Chamfer | G3Shell | G3Offset |
G3Slice | G3Bend | ExtentsX1 |
ExtentsX2 | ExtentsY1 | ExtentsY2 |
ExtentsZ1 | ExtentsZ2 | Text |
TextFont | TextStyle | Group |
SetProperties | PatternCopy |