Message 1 of 2
Steel Profile Optimization through Python script: Solve problem
Not applicable
09-17-2019
01:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone, I'm writing a script on python to optimize the profiles of a steel structure. after defining the geometric model and the properties of the elements, I cannot start the optimization command in the steel design tab.
the problem occurs precisely in the last string when the .Solve function is invoked, but this doesn't work, maybe for the wrong object (null). See the attached for clarity, really thanks
..
...
app = RobotApplicationClass()
project = app.Project
dim = project.DimServer
calc = dim.CalculEngine
calcpars = calc.GetCalcParam()
calcconfs = calc.GetCalcConf()
strm.Clear()
calcconfs.SetParamValue(3,0.9)
strm.WriteText("1 2 3 4")
calcpars.SetObjsList(3,strm)
calcpars.SetLimitState(1,1) #ULS on
calcpars.SetLimitState(2,0) #SLS off
strm.Clear()
calcpars.SetLoadsList(strm)
optpars = calcpars.GetOptimParam()
optpars.Optimization=1
optpars.SetOption(1,1)
optpars.SetOption(2,0)
optpars.SetLimit(2,0.5)
optpars.SetOption(3,0)
optpars.SetLimit(3,0.1)
optpars.SetOption(4,0)
optpars.SetLimit(4,0.01)
optpars.SetOption(5,0)
optpars.SetLimit(5,0.01)
optpars.SetOption(6,0)
optpars.SetOption(7,0)
calcpars.SetOptimParam(optpars)
calc.SetCalcParam(calcpars)
calc.SetCalcConf(calcconfs)
calc.Solve(null)