3DCoatScripting  4.8.31β
You can manage 3DСoat features with help of scripting
🌀 Create the automatic scripts for primitives

Added a Script command generator in the 3DCoat for the Primitives tool, Sculpt and Retopo rooms. You can save your actions in a script file, change your primitive parameters in the script and run it again.

Primitives Tool Script Recording in the Sculpt Room

To demonstrate the script recording in the Sculpt room, check here

Copy this script to your local drive and run it from 3DCoat: "Script / Run Script". Don't know how to do that, check here.

// This file generated after the script recording in the sculpt room.
void main() {
Coat coat;
UI ui;
// go to sculpt room
coat.room("Sculpt");
Symmetry symm;
// enable the symmetry window
symm.Enable(true);
symm.ShowPlane(true);
symm.Type(0);
// set mirror to "false"
symm.SetMirror(false,0);
symm.SetMirror(false,1);
symm.SetMirror(false,2);
symm.CoordSystemXYZ(0);
symm.StartPoint(Vec3(0.00,0.00,0.00));
SculptRoom sculpt;
// clear the room
sculpt.clear();
sculpt.toVoxel();
// vox object
Vox vox1;
vox1.clearScene();
vox1.rename("Volume5");
// prepare the primitives tool
PrimitivesTool tool;
// go to the primitives
coat.room("Sculpt");
ui("$SCULP_PRIM");
// gets sphere prim
SpherePrim sphere1;
sphere1 = tool.sphere();
// init parameters
sphere1.useDiameter(false);
sphere1.Position(Vec3(0.00,0.00,0.00));
sphere1.Radius(15.00);
// go to surface mode
vox1.toSurface();
ui("$SCULP_PRIM");
// get the cube object
CubPrim cube2;
cube2 = tool.cube();
// init parameters
cube2.AxisX(Vec3(1.00,0.00,0.00));
cube2.AxisY(Vec3(0.00,1.00,0.00));
cube2.AxisZ(Vec3(0.00,0.00,1.00));
cube2.useFillet(true);
cube2.Position(Vec3(0.00,0.00,0.00));
cube2.SideA(30.00);
cube2.SideB(30.00);
cube2.SideC(30.00);
cube2.details(0.36);
// change position and sides
cube2.Position(Vec3(0.00,0.00,-191.27));
cube2.SideA(434.41);
cube2.SideB(12.88);
cube2.SideC(896.92);
// add cube in the scene
tool.Apply(0);
// go to the primitives
ui("$SCULP_PRIM");
Step(1);
// create the cylinder
CylinderPrim cylinder4;
cylinder4 = tool.cylinder();
// init parameters
cylinder4.useDiameter(false);
cylinder4.useFillet(false);
cylinder4.useSector(false);
cylinder4.startPoint(Vec3(0.00,0.00,0.00));
cylinder4.endPoint(Vec3(0.00,20.00,0.00));
cylinder4.height(20.00);
cylinder4.radius(10.00);
cylinder4.topRadius(10.00);
cylinder4.bottomRadius(10.00);
cylinder4.scalex(1.00);
cylinder4.scaley(1.00);
cylinder4.details(0.36);
// change the positions
cylinder4.startPoint(Vec3(153.52,-6.44,194.20));
cylinder4.endPoint(Vec3(153.52,-126.74,194.20));
// new height, radius
cylinder4.height(120.30);
cylinder4.radius(31.52);
cylinder4.topRadius(31.52);
cylinder4.bottomRadius(31.52);
// add cylinder in the scene
tool.Apply(0);
// sets the new position
cylinder4.startPoint(Vec3(-147.54,-6.44,191.79));
cylinder4.endPoint(Vec3(-147.54,-126.74,191.79));
// add the cylinder in the scene
tool.Apply(0);
// sets the new position
cylinder4.startPoint(Vec3(150.98,-6.44,-577.69));
cylinder4.endPoint(Vec3(150.98,-126.74,-577.69));
// add the cylinder in the scene
tool.Apply(0);
// sets the new position
cylinder4.startPoint(Vec3(-149.89,-6.44,-568.62));
cylinder4.endPoint(Vec3(-149.89,-126.74,-568.62));
// add the cylinder in the scene
tool.Apply(0);
// go to the primitives
ui("$SCULP_PRIM");
// create the NGon
NGonPrim ngon8;
ngon8 = tool.ngon();
// init parameters
ngon8.useDiameter(false);
ngon8.useFillet(false);
ngon8.startPoint(Vec3(0.00,0.00,0.00));
ngon8.endPoint(Vec3(0.00,20.00,0.00));
ngon8.height(20.00);
ngon8.radius(10.00);
ngon8.topRadius(10.00);
ngon8.bottomRadius(10.00);
ngon8.Order(8);
ngon8.scalex(1.00);
ngon8.scaley(1.00);
// detail level
ngon8.details(0.36);
// change the position
ngon8.startPoint(Vec3(-75.14,6.44,99.46));
ngon8.endPoint(Vec3(-75.14,356.44,99.46));
// change the radius
ngon8.radius(65.01);
ngon8.topRadius(65.01);
ngon8.bottomRadius(65.01);
// add the NGon in the scene
tool.Apply(0);
// go to the primitives
ui("$SCULP_PRIM");
Step(1);
// create the gear
GearPrim gear9;
gear9 = tool.gear();
// init parameters
gear9.useDiameter(false);
gear9.startPoint(Vec3(0.00,0.00,0.00));
gear9.endPoint(Vec3(0.00,20.00,0.00));
gear9.height(20.00);
gear9.radius(10.00);
gear9.topRadius(10.00);
gear9.bottomRadius(10.00);
gear9.Depth(0.20);
gear9.Sharpness(0.50);
gear9.Order(16);
gear9.scalex(1.00);
gear9.scaley(1.00);
gear9.details(0.36);
// change position
gear9.startPoint(Vec3(-64.67,6.44,-410.43));
gear9.endPoint(Vec3(-64.67,300.44,-410.43));
// change radius
gear9.radius(55.01);
gear9.topRadius(55.01);
gear9.bottomRadius(55.01);
//add the gear in the scene
tool.Apply(0);
// go to the primitives
ui("$SCULP_PRIM");
Step(1);
// create the font object
Font font;
font.Name("Arial");
font.Size(384);
font.Weight(0);
font.Style(0);
font.OutPrecision(0);
font.ClipPrecision(0);
font.CharSet(0);
font.Quality(0);
font.Family(0);
// create the text object
TextPrim text11;
text11 = tool.text();
// sets text
text11.SetText("Hello world");
text11.AxisX(Vec3(1.00,0.00,0.00));
text11.AxisY(Vec3(0.00,1.00,0.00));
text11.AxisZ(Vec3(0.00,0.00,1.00));
text11.Position(Vec3(0.00,0.00,0.00));
// text sides
text11.SideA(50.00);
text11.SideB(50.00);
text11.SideC(5.00);
text11.ExtraRotation(0.00);
// bend is false
text11.Bend(false);
// new axises
text11.AxisX(Vec3(-0.03,0.00,-1.00));
text11.AxisY(Vec3(0.00,1.00,0.00));
text11.AxisZ(Vec3(1.00,-0.00,-0.03));
// new position and sides
text11.Position(Vec3(72.97,68.81,-207.88));
text11.SideA(380.69);
text11.SideB(380.69);
text11.SideC(38.07);
//add the text in the scene
tool.Apply(0);
}

Primitives Tool Script Recording in the Retopo Room

To demonstrate the script recording in the Retopo room check here

// This file generated after the script recording in the retopo room.
void main() {
Coat coat;
// goto retopo room
coat.room("Retopo");
// symmetry object
Symmetry symm;
// enable window
symm.Enable(true);
symm.ShowPlane(true);
symm.Type(0);
// mirror set to "false"
symm.SetMirror(false,0);
symm.SetMirror(false,1);
symm.SetMirror(false,2);
symm.CoordSystemXYZ(0);
symm.StartPoint(Vec3(0.00,0.00,0.00));
// clear the retopo
RetopoRoom retopo;
retopo.clear();
// prepare the primitives tool
PrimitivesTool tool;
// go to the retopo primitives
coat.room("Retopo");
cmd("$RTP_PRIM");
// get the retopo sphere
rGeoSphere rsphere22;
rsphere22 = tool.rsphere();
// init parameters
rsphere22.useDiameter(false);
rsphere22.Position(Vec3(0.00,0.00,0.00));
rsphere22.Radius(10.00);
rsphere22.SubDivision(8);
// go to the retopo primitives
cmd("$RTP_PRIM");
Step(1);
// get the retopo box
rGeoBox rbox23;
rbox23 = tool.rbox();
// init parameters
rbox23.AxisX(Vec3(1.00,0.00,0.00));
rbox23.AxisY(Vec3(0.00,1.00,0.00));
rbox23.AxisZ(Vec3(0.00,0.00,1.00));
rbox23.useFillet(false);
rbox23.useUniform(true);
rbox23.Position(Vec3(0.00,0.00,0.00));
rbox23.SideA(30.00);
rbox23.SideB(30.00);
rbox23.SideC(30.00);
rbox23.DivX(1);
rbox23.DivY(1);
rbox23.DivZ(1);
rbox23.AverageDivision(12);
// change the sides
rbox23.SideA(134.45);
rbox23.SideB(134.45);
rbox23.SideC(134.45);
// add the box in the scene
tool.Apply();
// go to the retopo primitives
cmd("$RTP_PRIM");
Step(1);
// go to a sphere
tool.SetPrim("rsphere");
rsphere22.Position(Vec3(-83.80,182.77,57.41));
rsphere22.Radius(60.48);
// add the sphere in the scene
tool.Apply();
// go to the retopo primitives
cmd("$RTP_PRIM");
Step(1);
// get the retopo cylinder
rGeoCylinder rcylinder24;
rcylinder24 = tool.rcylinder();
// init parameters ( diameter, fillet, removecaps )
rcylinder24.useDiameter(false);
rcylinder24.useFillet(false);
rcylinder24.RemoveCaps(false);
// uniform subdivision
rcylinder24.useUniform(true);
// positions (start,end points)
rcylinder24.startPoint(Vec3(0.00,0.00,0.00));
rcylinder24.endPoint(Vec3(0.00,20.00,0.00));
// height, radius, topRadius, bottomRadius
rcylinder24.height(20.00);
rcylinder24.radius(0.00);
rcylinder24.topRadius(10.00);
rcylinder24.bottomRadius(10.00);
// scales
rcylinder24.scalex(1.00);
rcylinder24.scaley(1.00);
// custom divisions
rcylinder24.DivY(1);
rcylinder24.DivX(1);
rcylinder24.DivZ(3);
// average division
rcylinder24.AverageDivision(16);
// set the new positions
rcylinder24.startPoint(Vec3(60.54,134.45,61.37));
rcylinder24.endPoint(Vec3(60.54,163.89,61.37));
// set the new height, radius, topRadius, bottomRadius
rcylinder24.height(129.44);
rcylinder24.radius(47.91);
rcylinder24.topRadius(47.91);
rcylinder24.bottomRadius(47.91);
rcylinder24.DivZ(7);
// add the cylinder in the scene
tool.Apply();
// go to the retopo primitives
cmd("$RTP_PRIM");
Step(1);
// get the retopo cone
rGeoCone rcone25;
rcone25 = tool.rcone();
// init parameters (diameters, fillet)
rcone25.useDiameter(false);
rcone25.useFillet(false);
// uniform subdivision
rcone25.useUniform(true);
// set the positions
rcone25.startPoint(Vec3(0.00,0.00,0.00));
rcone25.endPoint(Vec3(0.00,20.00,0.00));
// height & radius
rcone25.height(20.00);
rcone25.bottomRadius(10.00);
// scales
rcone25.scalex(1.00);
rcone25.scaley(1.00);
// custom divisions
rcone25.DivY(1);
rcone25.DivX(1);
rcone25.DivZ(3);
// average division
rcone25.AverageDivision(12);
// change the parameters
rcone25.startPoint(Vec3(-65.00,134.45,-69.28));
rcone25.endPoint(Vec3(-65.00,198.84,-69.28));
rcone25.height(164.39);
rcone25.bottomRadius(47.91);
rcone25.DivY(4);
rcone25.DivZ(4);
// add the cone in the scene
tool.Apply();
// go to the retopo primitives
cmd("$RTP_PRIM");
Step(1);
// get the retopo spiral
rGeoSpiral rspiral31;
rspiral31 = tool.rspiral();
// init parameters (axises)
rspiral31.AxisX(Vec3(0.00,0.00,-1.00));
rspiral31.AxisY(Vec3(1.00,-0.00,0.00));
rspiral31.AxisZ(Vec3(0.00,-1.00,-0.00));
// uniform subdivision
rspiral31.useUniform(true);
// positions
rspiral31.Position(Vec3(0.00,0.00,0.00));
rspiral31.Position2(Vec3(0.00,2.00,0.00));
// sphere profile
rspiral31.UseRectProfile(false);
// outer diameter
rspiral31.OuterDiameter(40.00);
// pitch
rspiral31.Pitch(20.00);
// profile params (d & r)
rspiral31.ProfileDiameter(10.00);
rspiral31.ProfileRadiusRelation(0.50);
// amount of turns
rspiral31.Turns(10);
// clockwise direction
rspiral31.ClockWise(true);
// custom subdivisions
rspiral31.DivY(3);
rspiral31.DivX(3);
rspiral31.DivZ(3);
// average division
rspiral31.AverageDivision(3);
// change the axises
rspiral31.AxisX(Vec3(-1.00,-0.07,0.00));
rspiral31.AxisY(Vec3(-0.07,1.00,0.00));
rspiral31.AxisZ(Vec3(-0.00,0.00,-1.00));
// set the new positions
rspiral31.Position(Vec3(-8.92,24.72,134.45));
rspiral31.Position2(Vec3(-8.92,24.72,136.45));
// set the new outer diameter
rspiral31.OuterDiameter(120);
// change the pitch
rspiral31.Pitch(47.91);
rspiral31.ProfileDiameter(30);
// change the divisions
rspiral31.DivY(8);
rspiral31.DivZ(1);
// change the average divisions
rspiral31.AverageDivision(16);
// add the spiral in the scene
tool.Apply();
// change locations (axes & positions)
rspiral31.AxisX(Vec3(-0.00,0.13,0.99));
rspiral31.AxisY(Vec3(0.00,0.99,-0.13));
rspiral31.AxisZ(Vec3(-1.00,0.00,-0.00));
rspiral31.Position(Vec3(134.45,29.35,-0.27));
rspiral31.Position2(Vec3(136.45,29.35,-0.27));
// add the spiral in the scene
tool.Apply();
}