RSA Dynamo API python continue untill

@jacob.small @Jonathan.Olesen @alex.mcfadyen many many thanks for all your thoughts and help.
I got my script solved.

Jonathan, i don’t know the capacity of the pile, because the pile load is an interaction between the number of piles and the total load. within the load i’m considering horizontal force, vertical force and a moment due to excentricity, which all influences the stability of the pile.

Alex, 1. i get your point, but i’m not allowed to change the pile dimensions.
2. the bearing capacity is checked in an other part of the module i’m building. but as mentioned in the answer to Jonathan i have to deal with the moments and horizontal force.

And here it is. For everyone whos’s using this script(which has in my opinion a lot of potentional) keep in mind that i haven’t used a break function at the end, so if you have a structure where your “Unity” will never reach <1 the script will run forever.


This is the script. including the robot calculate and steel design calculate.

  import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

from System import Environment
user = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
clr.AddReferenceToFileAndPath(user +r"\Dynamo\Dynamo Core\1.3\packages\Structural Analysis for Dynamo\bin\RSA\Interop.RobotOM.dll")
from RobotOM import *
from System import Object

objects = IN[0]
LoadCaseID = IN[1]
ILRT = IN[2]
FYH = IN[3]
FZV = IN[4]
CX = IN[5]
Location = IN[6]
File = IN[7]
application = RobotApplicationClass()
project = application.Project
structure = project.Structure
labels = structure.Labels
loads = structure.Cases

i = 1
Unity = 1.1
Paalbelasting = []
allUC = []
while Unity>=1:
	PaalbelH = FYH/i
	PaalbelZ = FZV/i
	PaalbelCX = CX/i	
	CreatedLoads = []
	for j in range(len(LoadCaseID)):
		cas = structure.Cases.Get(LoadCaseID[j])
		simplecase = IRobotSimpleCase
		simplecase = cas
		rec = IRobotLoadRecord
		IRobotLoadRecordMngr = simplecase.Records
		count = IRobotLoadRecordMngr.Count
		for k in range(count+1)[::-1]:
			rec = simplecase.Records.Delete(k)
		Uniform = []
		Uniform.append(simplecase.Records.New(ILRT[j]))
		LoadRecord = simplecase.Records.Get(Uniform[0])
		LoadRecord.SetValue(0,0)
		LoadRecord.SetValue(1,PaalbelH)
		LoadRecord.SetValue(2,PaalbelZ)
		LoadRecord.SetValue(3,PaalbelCX)
		LoadRecord.Objects.FromText(objects[j])
		CreatedLoads.append(LoadRecord.UniqueID)
	application.Project.ViewMngr.Refresh()
	calcEngine = project.CalcEngine
	calcEngine.AutoGenerateModel = True
	calcEngine.UseStatusWindow = True
	calcEngine.Calculate()
	RDMServer = IRDimServer
	RDMServer = application.Kernel.GetExtension("RDimServer")
	RDMServer.Mode = 1
	RDmEngine = IRDimCalcEngine
	RDmEngine = RDMServer.CalculEngine
	RDMCalpar = IRDimCalcParam
	RDMCalCnf = IRDimCalcConf
	RDMCalpar = RDmEngine.GetCalcParam()
	RDMCalCnf = RDmEngine.GetCalcConf()
	RdmStream = IRDimStream
	RdmStream = RDMServer.Connection.GetStream()
	RdmStream.Clear()
	RdmStream.WriteText("all")
	RDMCalpar.SetObjsList(IRDimCalcParamVerifType.I_DCPVT_MEMBERS_VERIF, RdmStream)
	RDMCalpar.SetLimitState(IRDimCalcParamLimitStateType.I_DCPLST_ULTIMATE,1)
	RdmStream.Clear()
	RdmStream.WriteText("1to7")
	RDMCalpar.SetLoadsList(RdmStream)
	RDmEngine.Solve(RdmStream)
	RdmAllResObjType = IRDimAllResObjectType
	RdmAllRes = IRDimAllRes
	RdmAllRes = RDmEngine.Results()
	RdmAllResObjType = 1
	ObjCnt = RdmAllRes.ObjectsCount
	RDmRetValue = IRDimMembCalcRetValue
	RDmDetRes = IRDimDetailedRes
	RDmDetRes = RdmAllRes.Get("1")
	Case = RDmDetRes.GovernCaseName
	Ratio = RDmDetRes.Ratio
	RdmCodeRes = object
	RdmCodeRes = RDmDetRes.CodeResults
	Nbyrd = RdmCodeRes.BuckStrenNbyrd
	Unity = Ratio
	allUC.append(Unity)
	i=i+1
aantalpalen = i-1
aantalp = str(aantalpalen)
project.SaveAs(Location+"\\"+ File + aantalp + ".rtd")
OUT = CreatedLoads, count, Unity, allUC, aantalpalen, Case,	PaalbelH, PaalbelZ, PaalbelCX

Where is this script going to be used for:
I’m building a module for a client which will deliver a CPT and the vertical and horizontal load of a building. the module i’m building is to determine which is the best combination of number of piles in relation to it’s pile length. Considering all the check’s that has to be done conform the geotechnical eurocde 7.(that’s why the horizontal supports of the pile are Non-linear support based on the soil layers determined from the CPT).

If anyone of you have suggestions (maybe for the break function) or want to know more just aks.

thanks everybody.
Robot forum
gr Edward
this is the script now Calc +1 script 0_03.dyn (9.3 KB)

3 Likes