I am trying to recursively add new supports to a floor plate with every analysis. So the idea is to check for max nodal displacement and add a support at that location and then reanalyze and repeat the process for a fixed number of iterations.
I am trying to script that in python with the help of all the example files published but to no success, obviously doing something wrong. Any guidance is appreciated Here is the code:
import clr clr.AddReferenceToFileAndPath("C:\Program Files\Rhino 7\Plug-ins\Karamba\Karamba.gha") clr.AddReferenceToFileAndPath("C:\Program Files\Rhino 7\Plug-ins\Karamba\KarambaCommon.dll") import Karamba.Models.Model as Model import Karamba.Results as Result import Karamba.Algorithms as Algorithm import Karamba.Nodes as Nodes import Karamba.Supports as Support import Karamba.GHopper.Models as GModel import Rhino.Geometry as rg out = Algorithm.ThIAnalyze.solve(model) model = out node_count = model.nodes.Count node_disp = Result.NodalDisp.solve(model,0) max_disp_ind = 0 max_disp = node_disp.Length for i in range (0,node_count-1): disp = node_disp[i].Length if max_disp < disp: max_disp = disp max_disp_ind = i col = Support.Support(max_disp_ind) model.supports.Add(col) b = max_disp_ind final = Algorithm.ThIAnalyze.solve(model) z = final a = GModel.GH_Model(z)
Thanks in advance,