Just like Rhino, many of the commands in Orca3D can be used in scripts to automate processes. A complete list of the Orca3D commands is shown in the Help file, in the Orca Command Reference chapter. The table also indicates whether each command is scriptable. Orca3D commands may be combined with Rhino commands to create very powerful scripts.
In one example, a user developed an optimization system with Model Center which scripted the Orca3D hull assistant and resistance prediction functions to optimize a hull form (you can see it in action at https://youtu.be/42tdvX7NJM0). Another use for a script is to automate something that is simple yet repetitive. For example, if you had a number of weight items that you wished to include in your Orca3D Weight/Cost model, you could use the interactive command and enter the name, center of gravity, and either the material or the weight and cost into the dialog box. This is fine when you have just a few points, but what if you have 20 or 30?
The easiest way to handle this situation is to create a text file that contains the “OrcaCreateWeightCostPoint” command for each item, with appropriate data for each. For example,
-orcacreateweightcostpoint PointName “Fuel Tank” Weight 90.5 CG -205,0,15 enter
-orcacreateweightcostpoint PointName “Starting Battery” UseStockMaterial “Group 27 Battery” CG -110, 0, 13 enter
-orcacreateweightcostpoint PointName “Port Outboard” Weight 120 CG -230,24,56 enter
-orcacreateweightcostpoint PointName “Starboard Outboard” Weight 120 CG -230,-24,56 enter
Note that for the scriptable version of any command in Rhino, the command should be prepended with a hyphen.The keywords for the command include PointName, CG,UseStockMaterial, MaterialCost, LaborCost, and Weight (in the command, they may be abbreviated by the letter that is underlined). Any arguments that have a space in them should be enclosed in quotes (e.g., “Group 27 Battery” for the stock material name or “Port Outboard” for the PointName). Each line should end with enter to finish the command. If you use theUseStockMaterial keyword, the material must already exist in your stock material library. When entering a list (such as the center of gravity coordinates), do not put a space after the comma.
Finally, use Rhino’s ReadCommandFile command to read the text file.