コード例 #1
0
        protected override void SolveInstance(IGH_DataAccess dataAccess)
        {
            double colMaxAngle = 0;
            var    modelIn     = new object();

            if (!dataAccess.GetData(0, ref modelIn))
            {
                return;
            }
            if (!dataAccess.GetData(1, ref colMaxAngle))
            {
                return;
            }

            if (!(modelIn is GH_Model ghKModel))
            {
                throw new ArgumentException("The input is not Karamba3D model!");
            }
            Model kModel = ghKModel.Value;
            var   k2S    = new K2S.K2StbModel(kModel);

            _sModel = k2S.SetByAngle(colMaxAngle);

            dataAccess.SetData(0, _sModel.StbMembers);
            dataAccess.SetData(1, _sModel.StbSections);
        }
コード例 #2
0
ファイル: ElementBuilder.cs プロジェクト: hrntsm/HoaryFox
        public static List <BuilderBeam> BuilderBeams(StbModel model, List <string>[] k3dIds)
        {
            var k3dBeams = new List <BuilderBeam>();

            StbNode[]  nodes   = model.StbNodes;
            StbMembers members = model.StbMembers;

            k3dBeams.AddRange(StbColumnToK3dBeam(k3dIds[0], nodes, members.StbColumns));
            k3dBeams.AddRange(StbGirderToK3dBeam(k3dIds[1], nodes, members.StbGirders));
            k3dBeams.AddRange(StbBraceToK3dBeam(k3dIds[2], nodes, members.StbBraces));

            return(k3dBeams);
        }