Hi, I'm student and I'm using Maxsurf Modeler Advanced Automation for my thesis.
I'm trying to do a TransformAdvanced of my model (using Python) but it doesn't work, and in VBA example or in Manual Modeler Automation there isn't this example function.
Now what I write in my code is:
Then the terminal return a: False, b:False, c:False so the SetTargets don't work.
Can you help me to solve this?
Depending on the hullform, there are limits to how far you can modify the hullform using the parametric transformation. Try it in the interactive UI to see if it works there with the model in question.
If you are still having difficulties, please submit a service request (see Help menu in MAXSURF applications)
I tried to do in interactive UI and it works, but in Modeler Automation doesn't work. It seem that the sequence of intructions that I use in Maxsurf Automation don't set the targetValue and search the new geometry like in interactive UI.
Can you suggest me the sequence of instructions?
msApp.Design.Hydrostatics.InitAdvancedTransform (in terminal return True)
msApp.Design.Hydrostatics.SetTargetPrismatic(...) (return False)
ms.App.Design.Hydrostatics.SetTargetLWL(...) (return False)
msApp.Design.Hydrostatics.SetTargetBeam(...) (return False)
msApp.Design.Hydrostatics.AdvancedTransform (return True)
This example doesn't work, I tried and retried. Maybe there are some tricks.
See attached version of the SystematicSeries file that comes in the install folder with MAXSURF. I've tweaked a couple of bugs in it. That might be able to get you going
I'll take a look at your questions using the .AdvancedTransform method and see if there are any issues there.
here is the sequence that is required:
Design.Hydrostatics.Calculate <<< calculate the hydrostatics for the modelDesign.Hydrostatics.InitAdvancedTransform <<< initialise the transformDesign.Hydrostatics.SetTargetPrismatic(0.65) <<< set the target value; this must be achievable for the specific modelDesign.Hydrostatics.AdvancedTransform <<< perform the transformDesign.Hydrostatics.Calculate <<< recalculate the hydrostatics for the modified hullformDesign.Hydrostatics.Cp <<< check we got the prismatic we were after
in VBA in Excel, please try something like this ...
modelerApp.Design.Surfaces.Add (msSLSimpleYacht)modelerApp.Design.FrameOfReference.Baseline = modelerApp.Design.FrameOfReference.FindBasemodelerApp.Design.FrameOfReference.AftPerp = modelerApp.Design.FrameOfReference.FindAftDWLmodelerApp.Design.FrameOfReference.FwdPerp = modelerApp.Design.FrameOfReference.FindFwdDWLmodelerApp.Design.FrameOfReference.VertDatum = msVDTBaselinemodelerApp.Design.FrameOfReference.LongDatum = msLDTMidships
Dim val As Double
modelerApp.Design.Hydrostatics.Calculateval = modelerApp.Design.Hydrostatics.DisplacementRange("A1").Value = "Hydrostatics.Displacement"Range("B1").Value = val
val = modelerApp.Design.Hydrostatics.CpRange("A7").Value = "Hydrostatics.Cp"Range("B7").Value = val
modelerApp.Design.Hydrostatics.InitAdvancedTransformRange("A8").Value = "Hydrostatics.InitAdvancedTransform, SetTargetPrismatic"Range("B8").Value = 0.65Call modelerApp.Design.Hydrostatics.SetTargetPrismatic(0.65)modelerApp.Design.Hydrostatics.AdvancedTransform
modelerApp.Design.Hydrostatics.Calculateval = modelerApp.Design.Hydrostatics.CpRange("A9").Value = "Hydrostatics.Cp"Range("B9").Value = val
note that the COM interface can be sensitive to timings, you may need to pause while licensing initializes, for the application to start and also allow time for model to load etc.