I use Python to pilot a software named Orcaflex. Orcaflex has its own python library with functions.
Here is just an example to load a model and modify the position of the vessel
import OrcFxAPI as OF
model = OF.model()
model.LoadData(OrcaflexFile)
Vessel = model[VesselName]
Vessel.InitialX = 0
If I need to define the X, Y, Z position, I will write:
Vessel.InitialX = 0
Vessel.InitialY = 10
Vessel.InitialZ = 5
But I would like to make a loop, I know the below is an horror, but it is just to show what I would like to do:
pos = [0,10,5]
dof = ['X','Y','Z']
for i in range(3):
Vessel.Initial + dof[i] = pos[i]
So how should I do that properly ?