Steel Profile Optimization through Python script: Solve problem

Steel Profile Optimization through Python script: Solve problem

Anonymous
Not applicable
687 Views
1 Reply
Message 1 of 2

Steel Profile Optimization through Python script: Solve problem

Anonymous
Not applicable

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)

 ROBOTT.JPG

0 Likes
688 Views
1 Reply
Reply (1)
Message 2 of 2

1234eddie
Advocate
Advocate

@Anonymous 

 

don't know if you have still this problem.

 i have had the same and i solved it. see this link

 

Gr Edward

0 Likes