Generate Hull Objects from XML File
- Last UpdatedNov 27, 2023
- 2 minute read
You can model all curved hull objects via Vitesse by creating a input file in XML format and then run this file. The input language of the input file is identical to that of "Batch Curved Hull". This input language is thoroughly described in Hull \ Curved Modelling \ User’s Guide Batch \ Input Language of Curved Hull Modelling. It will not be further explained here.
The XML input file may be created by using methods in PyXML. PyXML is an extension to Python that handle XML document. One features of PyXML is that it implements the DOM interface and standard interface (defined by W3C) to handle the tree structure of an XML. You may create a new document, add element and attributes. PyXML and DOM will not be documented here.
For PyXML, please refer to the Python web site.
You will find documentation on DOM on the web site of the World Wide Web Consortium, www.w3c.org
PyXML will be delivered together with Vitesse, version M3 or later. You will also find an example of how to use PyXML/DOM, kcs_ex_hull_XML.py.
|
run_XML(XmlFileName, LogFileName) |
||
|
Generates a number of curved hull object described in the XML document. The objects described in the XML file will be created and also stored in the data bank. |
||
|
Input Parameters: |
||
|
XmlFileName |
string |
The full path name of the XML input file. |
|
LogFileName |
string |
The full path name of a log file, where you will find detailed information about the XML generation. If empty string, log messages will appear in the standard output log file of curved hull modelling application. |
|
Returned value: |
||
|
[0]SuccessList |
List of KcsModel objects |
A list of all successfully created curved model objects. Each KcsModel object contains type and name. |
|
Exceptions: |
||
|
kcs_ArgumentError |
Invalid input parameter. |
|
|
kcs_Error |
XML generation failed, see log file. |
|
|
output_XML(ModelList, OutputFileName) |
||
|
Get the XML description of existing curved hull model objects. |
||
|
Input Parameters: |
||
|
ModelList |
List of KcsModel objects |
Selects the objects for which an XML description will be created. Each object in the list is an instance of KcsModel. Type and name must be given. |
|
OutputFileName |
string |
The XML output file. Full path name of the file. An existing file will be overridden a non-existing file will be created. |
|
Returned value: |
||
|
none |
||
|
Exceptions: |
||
|
kcs_ArgumentError |
Invalid input parameter. |
|
|
kcs_ObjNotFound |
Object not found |
|
|
Example: |
||
|
# Example: kcs_ex_hull_XML.py |
||