Bladed Knowledge Base

Tip to locate the required Project API parameter
Category: Bladed API

Problem

It may be not easy to find the required API in the BladedAPIReference.chm file. How to quickly find the required Project API parameter?

Solution

There is a tip to use project xml file to locate the parameter. It can be found on the Bladed API user Manual Appendix D.1.
The user manual is under the Bladed installation folder. For example, C:\DNV\Bladed 4.x\Documentation\Bladed API by default.
Here is an example package, in which the current definitions are modified via APIs.


The detailed steps:
(1) In the Bladed GUI screen, load a basis project. Save this project file with name "a.prj".
(2) In the Bladed GUI screen, find the input parameter of interest and set its value to a value that is different from the basis project. Save it with name "b.prj".
In the example package, the current definition is changed.

(3) In the Project API, set the PreserveTempSubdirectoryContainingXmlProjectOnGetProject setting to true. 
(4) In the Project API, call GetProject twice, once to load a.prj and again to load b.prj. This will result in 2 xml files being stored on the file system. See the example script file.
(5) To locate the xml files, check the API log output.

   

(6) Compare the two xml files.
    According to the xml file structure, the required API for the current can be located.
    For example here, the near surface velocity is: prj.Environment.Sea.Currents.NearSurfaceVelocity





Keywords Project API