shipCreateShip.Tools Namespace Reference


def createShip (solids, L, B, T)

Function Documentation

def shipCreateShip.Tools.createShip (   solids,
Create a new ship instance

Position arguments:
solids -- List of hull solid shapes
L -- Ship length between perpendiculars
B -- Ship Breadth
T -- Ship design draft

Returned value:
The new ship object

The solids can be easily extracted from an already existing object. For
instance, to get the solids from the selected object simply type the
following command:

solids = Gui.ActiveDocument.ActiveObject.Object.Shape.Solids

Regarding the Lenght, Breadth, and Draft, it is strongly recommended to use
Units.parseQuantity method, e.g. The following obfuscated code snippet build
such variables:

import Units
L = Units.parseQuantity("25.5 m")
B = Units.parseQuantity("3.9 m")
T = Units.parseQuantity("1.0 m")