Examples
- Last UpdatedJan 07, 2026
- 1 minute read
This example shows how to calculate the total weight of a hull block, and then just print out the sum.
|
Example: |
|
|---|---|
|
import kcs_ui |
|
|
total_weight = 0.0 |
2 |
-
Make data extraction statements available in the Vitesse program.
-
Initialize sum variable.
-
Ask user to key in name of hull block to calculate weight for.
This command is further explained in User Interface.
-
Build up the data extraction string.
-
Do the actual data extraction.
-
Check the outcome of the extraction command.
-
Loop to pick up all the values from the data extraction result tree.
-
Add the weight from this panel to the total sum.
-
Simply print out the sum accompanied with a simple explanation.