Beispiel #1
0
 void Save()
 {
     if (_paths != null)
     {
         ProjectPrefs.SetString(ProjectPrefsKey, JsonSerialization.SerializeStatic(_paths));
     }
 }
 void OnEnable()
 {
     titleContent.text = Title;
     _fileName         = ProjectPrefs.GetString(TargetFileKey, DefaultFileName);
     _nsName           = ProjectPrefs.GetString(NamespaceKey, DefaultNamespace);
     _options          = (Options)ProjectPrefs.GetInt(OptionsKey, (int)DefaultOptions);
 }
Beispiel #3
0
        protected override void Save()
        {
            var saveData = new List <SaveData>();

            foreach (var item in pinning)
            {
                if (item == null || item.target == null)
                {
                    continue;
                }

                var guid = UnityEditorUtility.GetAssetGUID(item.target);

                var data = new SaveData()
                {
                    guid    = guid,
                    comment = item.comment,
                };

                saveData.Add(data);
            }

            if (saveData.Any())
            {
                ProjectPrefs.Set(PinnedPrefsKey, saveData);
            }
            else
            {
                if (ProjectPrefs.HasKey(PinnedPrefsKey))
                {
                    ProjectPrefs.DeleteKey(PinnedPrefsKey);
                }
            }
        }
        void OnGUI()
        {
            if (_optionNames == null)
            {
                _optionNames = Enum.GetNames(typeof(Options));
            }

            _settings.Filename = EditorGUILayout.TextField("Target file", _settings.Filename).Trim();
            if (string.IsNullOrEmpty(_settings.Filename))
            {
                _settings.Filename = DefaultFilename;
            }
            _settings.Namespace = EditorGUILayout.TextField("Namespace", _settings.Namespace).Trim();
            if (string.IsNullOrEmpty(_settings.Namespace))
            {
                _settings.Namespace = DefaultNamespace;
            }
            _settings.Options = (Options)EditorGUILayout.MaskField("Options", (int)_settings.Options, _optionNames);

            _settings.IgnoredPaths = EditorGUILayout.TextField("Ignore assets at paths", _settings.IgnoredPaths).Trim();

            if (GUILayout.Button("Reset settings"))
            {
                ProjectPrefs.DeleteKey(SettingsKey);
                OnEnable();
                Repaint();
            }
            if (GUILayout.Button("Save settings & generate"))
            {
                ProjectPrefs.SetString(SettingsKey, Singleton.Get <JsonSerialization> ().Serialize(_settings));
                var res = Generate(_settings);
                EditorUtility.DisplayDialog(titleContent.text, res ?? "Success", "Close");
            }
        }
Beispiel #5
0
        protected override void Save()
        {
            currentScene = SceneManager.GetActiveScene();

            UpdatePinnedObjectIds();

            ProjectPrefs.SetString(PinnedPrefsKey, string.Join(",", pinnedObjectIds.Select(x => x.ToString()).ToArray()));
        }
Beispiel #6
0
        protected override void Save()
        {
            var pinnedObjectGUIDs = pinnedObject
                                    .Where(x => x != null)
                                    .Select(x => AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(x)))
                                    .ToArray();

            ProjectPrefs.SetString(PinnedPrefsKey, string.Join(",", pinnedObjectGUIDs));
        }
Beispiel #7
0
 void Save()
 {
     if (_paths != null && _paths.Count > 0)
     {
         ProjectPrefs.SetString(ProjectPrefsKey, Singleton.Get <JsonSerialization> ().Serialize(_paths));
     }
     else
     {
         ProjectPrefs.DeleteKey(ProjectPrefsKey);
     }
 }
 void Save()
 {
     if (_items != null && _items.Count > 0)
     {
         ProjectPrefs.SetString(ProjectPrefsKey, Service <JsonSerialization> .Get().Serialize(_items));
     }
     else
     {
         ProjectPrefs.DeleteKey(ProjectPrefsKey);
     }
 }
 void Save()
 {
     if (_items != null && _items.Count > 0)
     {
         ProjectPrefs.SetString(ProjectPrefsKey, _serializer.Serialize(_items));
     }
     else
     {
         ProjectPrefs.DeleteKey(ProjectPrefsKey);
     }
 }
 void Load()
 {
     try {
         _items = _serializer.Deserialize <List <RecordInfo> > (ProjectPrefs.GetString(ProjectPrefsKey, "{}"));
         if (_items == null)
         {
             throw new Exception();
         }
     } catch {
         _items = new List <RecordInfo> ();
     }
 }
Beispiel #11
0
 void OnEnable()
 {
     titleContent.text = Title;
     _settings         = null;
     try {
         _settings = _serializer.Deserialize <GenerationSettings> (ProjectPrefs.GetString(SettingsKey));
     } catch { }
     if (_settings == null)
     {
         _settings = new GenerationSettings();
     }
 }
 static void SaveInfo()
 {
     if (_allDescs.Count > 0)
     {
         try {
             ProjectPrefs.SetString(StorageKey, JsonSerialization.SerializeStatic(_allDescs));
         } catch {
         }
     }
     else
     {
         ProjectPrefs.DeleteKey(StorageKey);
     }
 }
Beispiel #13
0
 void Load()
 {
     try {
         _paths = Singleton.Get <JsonSerialization> ()
                  .Deserialize <Dictionary <string, string> > (
             ProjectPrefs.GetString(ProjectPrefsKey, string.Empty));
         if (_paths == null)
         {
             throw new Exception();
         }
     } catch {
         _paths = new Dictionary <string, string> ();
     }
 }
 static void LoadInfo()
 {
     try {
         _allDescs = Singleton.Get <JsonSerialization> ()
                     .Deserialize <Dictionary <string, FolderIconDesc> > (
             ProjectPrefs.GetString(StorageKey, "{}"));
         if (_allDescs == null)
         {
             throw new Exception();
         }
     } catch {
         _allDescs = new Dictionary <string, FolderIconDesc> ();
     }
 }
Beispiel #15
0
 static void SaveInfo()
 {
     if (_allDescs.Count > 0)
     {
         try {
             ProjectPrefs.SetString(StorageKey, Service <JsonSerialization> .Get().Serialize(_allDescs));
         } catch (Exception ex) {
             Debug.LogWarning("FolderIconEditor.SaveInfo: " + ex.Message);
         }
     }
     else
     {
         ProjectPrefs.DeleteKey(StorageKey);
     }
 }
Beispiel #16
0
        public static bool Header(string text, string key, Color?color = null, bool defaultState = true)
        {
            var state = ProjectPrefs.GetBool(key, defaultState);

            EditorGUI.BeginChangeCheck();

            state = Header(text, state, color);

            if (EditorGUI.EndChangeCheck())
            {
                ProjectPrefs.SetBool(key, state);
            }

            return(state);
        }
        public static bool DrawHeader(string text, string key, Color?color = null)
        {
            var state = ProjectPrefs.GetBool(key, true);

            GUI.changed = false;

            state = DrawHeader(text, state, color);

            if (GUI.changed)
            {
                ProjectPrefs.SetBool(key, state);
            }

            return(state);
        }
Beispiel #18
0
        protected override void Load()
        {
            var pinned = ProjectPrefs.GetString(PinnedPrefsKey);

            if (string.IsNullOrEmpty(pinned))
            {
                return;
            }

            pinnedObject = pinned
                           .Split(',')
                           .Select(x => AssetDatabase.GUIDToAssetPath(x))
                           .Select(x => AssetDatabase.LoadAssetAtPath <Object>(x))
                           .Where(x => x != null)
                           .ToList();
        }
Beispiel #19
0
        void OnGUI()
        {
            GUILayout.Label("AssetBundles Settings", EditorStyles.boldLabel);

            GUILayout.BeginHorizontal(GUI.skin.box);
            GUILayout.BeginVertical();

            GUILayout.BeginHorizontal();
            _settings.Path = EditorGUILayout.TextField("Output Path:", _settings.Path).Trim();
            if (string.IsNullOrEmpty(_settings.Path))
            {
                _settings.Path = DefaultPath;
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("Options:", EditorStyles.label, GUILayout.Width(EditorGUIUtility.labelWidth));
            _settings.Options = (BuildAssetBundleOptions)EditorGUILayout.EnumPopup(DefaultOptions);
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("Platform:", EditorStyles.label, GUILayout.Width(EditorGUIUtility.labelWidth));
            _settings.Target = (BuildTarget)EditorGUILayout.EnumPopup(DefaultTarget);
            GUILayout.EndHorizontal();

            GUILayout.EndVertical();
            GUILayout.EndHorizontal();

            GUILayout.Space(10f);

            EditorGUILayout.HelpBox("Note: if you will load bundle directly from disk – choose option \"UncompressedAssetBundle\", to pack bundle and download from remote source – choose \"None\".", MessageType.Info, true);

            GUILayout.Space(10f);

            EditorGUILayout.Separator();
            if (GUILayout.Button("Save settings & build", GUILayout.Height(50f)))
            {
                ProjectPrefs.SetString(SettingsKey, Service <JsonSerialization> .Get().Serialize(_settings));
                var res = Generate(_settings);
                EditorUtility.DisplayDialog(titleContent.text, res ?? "Success", "Close");
                if (string.IsNullOrEmpty(res))
                {
                    EditorUtility.RevealInFinder(_settings.Path);
                }
            }
        }
Beispiel #20
0
        protected override void Load()
        {
            pinning = new List <PinnedItem>();

            var prefsKey = GetPinnedPrefsKey();

            var saveData = ProjectPrefs.Get <List <SaveData> >(prefsKey, null);

            if (saveData == null)
            {
                return;
            }

            if (saveData.Any())
            {
                // Hierarchy上のGameObjectを検索して取得.
                var hierarchyObjects = UnityEditorUtility.FindAllObjectsInHierarchy();

                foreach (var data in saveData)
                {
                    if (data.localIdentifierInFile == -1)
                    {
                        continue;
                    }

                    var targetObject = hierarchyObjects.FirstOrDefault(y => UnityEditorUtility.GetLocalIdentifierInFile(y) == data.localIdentifierInFile) as Object;

                    if (targetObject == null)
                    {
                        continue;
                    }

                    var item = new PinnedItem()
                    {
                        target  = targetObject,
                        comment = data.comment,
                    };

                    pinning.Add(item);
                }
            }
        }
Beispiel #21
0
        protected override void Save()
        {
            var prefsKey = GetPinnedPrefsKey();

            var saveData = new List <SaveData>();

            foreach (var item in pinning)
            {
                if (item == null || item.target == null)
                {
                    continue;
                }

                var localIdentifierInFile = UnityEditorUtility.GetLocalIdentifierInFile(item.target);

                if (localIdentifierInFile == -1)
                {
                    continue;
                }

                var data = new SaveData()
                {
                    localIdentifierInFile = localIdentifierInFile,
                    comment = item.comment,
                };

                saveData.Add(data);
            }

            if (saveData.Any())
            {
                ProjectPrefs.Set(prefsKey, saveData);
            }
            else
            {
                if (ProjectPrefs.HasKey(prefsKey))
                {
                    ProjectPrefs.DeleteKey(prefsKey);
                }
            }
        }
Beispiel #22
0
        protected override void Load()
        {
            pinning = new List <PinnedItem>();

            var saveData = ProjectPrefs.Get <List <SaveData> >(PinnedPrefsKey, null);

            if (saveData == null)
            {
                return;
            }

            foreach (var data in saveData)
            {
                if (string.IsNullOrEmpty(data.guid))
                {
                    continue;
                }

                var assetPath = AssetDatabase.GUIDToAssetPath(data.guid);

                if (string.IsNullOrEmpty(assetPath))
                {
                    continue;
                }

                var asset = AssetDatabase.LoadAssetAtPath <Object>(assetPath);

                if (asset == null)
                {
                    continue;
                }

                var item = new PinnedItem()
                {
                    target  = asset,
                    comment = data.comment,
                };

                pinning.Add(item);
            }
        }
Beispiel #23
0
        protected override void Load()
        {
            currentScene = SceneManager.GetActiveScene();

            var pinned = ProjectPrefs.GetString(PinnedPrefsKey);

            if (string.IsNullOrEmpty(pinned))
            {
                return;
            }

            // Hierarchy上のGameObjectを検索して取得.
            var hierarchyObjects = UnityEditorUtility.FindAllObjectsInHierarchy();

            pinnedObject = pinned
                           .Split(',')
                           .Select(x => hierarchyObjects.FirstOrDefault(y => LocalIdentifierInFile.Get(y).ToString() == x) as Object)
                           .Where(x => x != null)
                           .ToList();

            UpdatePinnedObjectIds();
        }
        // ReSharper disable once InconsistentNaming
        void OnGUI()
        {
            if (_optionNames == null)
            {
                _optionNames = Enum.GetNames(typeof(Options));
            }

            _fileName = EditorGUILayout.TextField("Target file", _fileName).Trim();
            if (string.IsNullOrEmpty(_fileName))
            {
                _fileName = DefaultFileName;
            }
            _nsName = EditorGUILayout.TextField("Namespace", _nsName).Trim();
            if (string.IsNullOrEmpty(_nsName))
            {
                _nsName = DefaultNamespace;
            }
            _options = (Options)EditorGUILayout.MaskField("Options", (int)_options, _optionNames);

            if (GUILayout.Button("Reset settings"))
            {
                ProjectPrefs.DeleteKey(TargetFileKey);
                ProjectPrefs.DeleteKey(NamespaceKey);
                ProjectPrefs.DeleteKey(OptionsKey);
                OnEnable();
                Repaint();
            }
            if (GUILayout.Button("Save settings & generate"))
            {
                ProjectPrefs.SetString(TargetFileKey, _fileName);
                ProjectPrefs.SetString(NamespaceKey, _nsName);
                ProjectPrefs.SetInt(OptionsKey, (int)_options);
                var res = Generate(_fileName, _nsName, _options);
                EditorUtility.DisplayDialog(titleContent.text, res ?? "Success", "Close");
            }
        }
Beispiel #25
0
 private static void InitializeOnLoadMethod()
 {
     LogEnable = ProjectPrefs.GetBool(PrefsKey, true);
 }
Beispiel #26
0
 public static void ToggleTuningLog()
 {
     LogEnable = !LogEnable;
     ProjectPrefs.SetBool(PrefsKey, LogEnable);
 }
Beispiel #27
0
 void OnEnable()
 {
     titleContent.text = Title;
     _settings         = null;
     try {
         _settings = Service <JsonSerialization> .Get().Deserialize <BuildSettings> (ProjectPrefs.GetString(SettingsKey));
     } catch { }
     if (_settings == null)
     {
         _settings = new BuildSettings();
     }
 }
Beispiel #28
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            // new object Robot application
            IRobotApplication robApp;

            robApp = new RobotApplicationClass();

            // if Robot is not visible
            if (robApp.Visible == 0)
            {
                // set robot visible and allow user interaction
                robApp.Interactive = 1;
                robApp.Visible     = 1;
            }
            // create a project concrete beam
            robApp.Project.New(IRobotProjectType.I_PT_SHELL);
            RobotProjectPreferences ProjectPrefs;

            ProjectPrefs = robApp.Project.Preferences;
            ProjectPrefs.SetActiveCode(IRobotCodeType.I_CT_RC_THEORETICAL_REINF, "BAEL 91");
            RobotMeshParams MeshParams;

            MeshParams = ProjectPrefs.MeshParams;
            MeshParams.SurfaceParams.Method.Method          = IRobotMeshMethodType.I_MMT_DELAUNAY;
            MeshParams.SurfaceParams.Generation.Type        = IRobotMeshGenerationType.I_MGT_ELEMENT_SIZE;
            MeshParams.SurfaceParams.Generation.ElementSize = 0.5;
            MeshParams.SurfaceParams.Delaunay.Type          = IRobotMeshDelaunayType.I_MDT_DELAUNAY;
            //Output.AddItem "Structure Generation..."
            IRobotStructure str;

            str = robApp.Project.Structure;
            str.Nodes.Create(1, 0, 0, 0);
            str.Nodes.Create(2, 3, 0, 0);
            str.Nodes.Create(3, 3, 3, 0);
            str.Nodes.Create(4, 0, 3, 0);
            str.Nodes.Create(5, 0, 0, 4);
            str.Nodes.Create(6, 3, 0, 4);
            str.Nodes.Create(7, 3, 3, 4);
            str.Nodes.Create(8, 0, 3, 4);
            str.Bars.Create(1, 1, 5);
            str.Bars.Create(2, 2, 6);
            str.Bars.Create(3, 3, 7);
            str.Bars.Create(4, 4, 8);
            str.Bars.Create(5, 5, 6);
            str.Bars.Create(6, 7, 8);
            RobotLabelServer labels;

            labels = str.Labels;
            string              ColumnSectionName = "Rect. Column 30*30";
            IRobotLabel         label             = labels.Create(IRobotLabelType.I_LT_BAR_SECTION, ColumnSectionName);
            RobotBarSectionData section;

            section           = (RobotBarSectionData)label.Data;
            section.ShapeType = IRobotBarSectionShapeType.I_BSST_CONCR_COL_R;
            RobotBarSectionConcreteData concrete;

            concrete = (RobotBarSectionConcreteData)section.Concrete;
            concrete.SetValue(IRobotBarSectionConcreteDataValue.I_BSCDV_COL_B, 0.3);
            concrete.SetValue(IRobotBarSectionConcreteDataValue.I_BSCDV_COL_H, 0.3);
            section.CalcNonstdGeometry();
            labels.Store(label);
            RobotSelection selectionBars;

            selectionBars = str.Selections.Get(IRobotObjectType.I_OT_BAR);
            selectionBars.FromText("1 2 3 4");
            //给量赋值截面
            str.Bars.SetLabel(selectionBars, IRobotLabelType.I_LT_BAR_SECTION, ColumnSectionName);
            RobotSectionDatabaseList steelSections;

            steelSections = ProjectPrefs.SectionsActive;
            if (steelSections.Add("RCAT") == 1)
            {
                MessageBox.Show("Steel section base RCAT not found...");
            }
            selectionBars.FromText("5 6");
            label = labels.Create(IRobotLabelType.I_LT_BAR_SECTION, "HEA 340");
            str.Labels.Store(label);
            str.Bars.SetLabel(selectionBars, IRobotLabelType.I_LT_BAR_SECTION, "HEA 340");
            string MaterialName = "Concrete 30";

            label = labels.Create(IRobotLabelType.I_LT_MATERIAL, MaterialName);
            RobotMaterialData Material;

            Material          = (RobotMaterialData)label.Data;
            Material.Type     = IRobotMaterialType.I_MT_CONCRETE;
            Material.E        = 30000000000; // Young
            Material.NU       = 1 / 6;       // Poisson
            Material.RO       = 25000;       // Unit weight
            Material.Kirchoff = Material.E / (2 * (1 + Material.NU));
            str.Labels.Store(label);
            RobotPointsArray points;

            points = (RobotPointsArray)robApp.CmpntFactory.Create(IRobotComponentType.I_CT_POINTS_ARRAY);
            points.SetSize(5);
            points.Set(1, 0, 0, 4);
            points.Set(2, 3, 0, 4);
            points.Set(3, 3, 3, 4);
            points.Set(4, 0, 3, 4);
            points.Set(5, 0, 0, 4);
            string SlabSectionName = "Slab 30";

            label = labels.Create(IRobotLabelType.I_LT_PANEL_THICKNESS, SlabSectionName);
            RobotThicknessData thickness;

            thickness = (RobotThicknessData)label.Data;
            thickness.MaterialName  = MaterialName;
            thickness.ThicknessType = IRobotThicknessType.I_TT_HOMOGENEOUS;
            RobotThicknessHomoData thicknessData;

            thicknessData            = (RobotThicknessHomoData)thickness.Data;
            thicknessData.ThickConst = 0.3;
            labels.Store(label);
            RobotObjObject slab;
            int            ObjNumber = str.Objects.FreeNumber;

            str.Objects.CreateContour(ObjNumber, points);
            slab = (RobotObjObject)str.Objects.Get(ObjNumber);
            slab.Main.Attribs.Meshed = 1;
            slab.SetLabel(IRobotLabelType.I_LT_PANEL_THICKNESS, SlabSectionName);
            slab.Initialize();
            points.Set(1, 1.1, 1.1, 4);
            points.Set(2, 2.5, 1.1, 4);
            points.Set(3, 2.5, 2.5, 4);
            points.Set(4, 1.1, 2.5, 4);
            points.Set(5, 1.1, 1.1, 4);
            RobotObjObject hole;
            int            HoleNumber = str.Objects.FreeNumber;

            str.Objects.CreateContour(HoleNumber, points);
            hole = (RobotObjObject)str.Objects.Get(HoleNumber);
            hole.Main.Attribs.Meshed = 0;
            hole.Initialize();
            string FootName = "Foot";

            label = labels.Create(IRobotLabelType.I_LT_SUPPORT, FootName);
            RobotNodeSupportData footData;

            footData    = (RobotNodeSupportData)label.Data;
            footData.UX = 1;
            footData.UY = 1;
            footData.UZ = 0;
            footData.KZ = 80000000;
            footData.RX = 1;
            footData.RY = 1;
            footData.RZ = 1;
            labels.Store(label);
            RobotSelection SelectionNodes;

            SelectionNodes = str.Selections.Get(IRobotObjectType.I_OT_NODE);
            SelectionNodes.FromText("1 2 3 4");
            str.Nodes.SetLabel(SelectionNodes, IRobotLabelType.I_LT_SUPPORT, FootName);
            RobotLoadRecord LoadRecord;
            //self weight on entire structure
            RobotSimpleCase caseSW;

            caseSW = str.Cases.CreateSimple(1, "SW", IRobotCaseNature.I_CN_PERMANENT, IRobotCaseAnalizeType.I_CAT_STATIC_LINEAR);
            caseSW.Records.New(IRobotLoadRecordType.I_LRT_DEAD);
            LoadRecord = (RobotLoadRecord)caseSW.Records.Get(1);
            LoadRecord.SetValue(System.Convert.ToInt16(IRobotDeadRecordValues.I_DRV_Z), -1);
            LoadRecord.SetValue(System.Convert.ToInt16(IRobotDeadRecordValues.I_DRV_ENTIRE_STRUCTURE), 0);
            //contour live load on the slab
            RobotSimpleCase CaseLive;

            CaseLive = str.Cases.CreateSimple(2, "Live", IRobotCaseNature.I_CN_EXPLOATATION, IRobotCaseAnalizeType.I_CAT_STATIC_LINEAR);
            int Uniform = CaseLive.Records.New(IRobotLoadRecordType.I_LRT_UNIFORM);

            LoadRecord = (RobotLoadRecord)CaseLive.Records.Get(Uniform);
            LoadRecord.SetValue(System.Convert.ToInt16(IRobotUniformRecordValues.I_URV_PX), 0);
            LoadRecord.SetValue(System.Convert.ToInt16(IRobotUniformRecordValues.I_URV_PY), 0);
            LoadRecord.SetValue(System.Convert.ToInt16(IRobotUniformRecordValues.I_URV_PZ), -10000);
            //apply created load to the slab
            LoadRecord.Objects.FromText(System.Convert.ToString(ObjNumber));
            //linear wind load on the beam
            RobotSimpleCase CaseWind;

            CaseWind   = str.Cases.CreateSimple(3, "Wind", IRobotCaseNature.I_CN_WIND, IRobotCaseAnalizeType.I_CAT_STATIC_LINEAR);
            Uniform    = CaseWind.Records.New(IRobotLoadRecordType.I_LRT_BAR_UNIFORM);
            LoadRecord = (RobotLoadRecord)CaseWind.Records.Get(Uniform);
            LoadRecord.SetValue(System.Convert.ToInt16(IRobotUniformRecordValues.I_URV_PX), 0);
            LoadRecord.SetValue(System.Convert.ToInt16(IRobotUniformRecordValues.I_URV_PY), 1000);
            LoadRecord.SetValue(System.Convert.ToInt16(IRobotUniformRecordValues.I_URV_PZ), 0);
            //apply created load to the beam
            //将荷载作用到梁上面
            LoadRecord.Objects.FromText("5");
            RobotCalcEngine CalcEngine = robApp.Project.CalcEngine;

            CalcEngine.GenerationParams.GenerateNodes_BarsAndFiniteElems = true;
            CalcEngine.UseStatusWindow = true;
            this.Activate();
            if (CalcEngine.Calculate() == 1)
            {
                MessageBox.Show("Calculation Failed!", "Calculations");
            }
            else
            {
                MessageBox.Show("Done!", "Calculations");
            }
            CalcEngine = null;
            RConcrCalcEngine concrCalcEngine;

            concrCalcEngine = robApp.Project.ConcrReinfEngine;
            RConcrSlabRequiredReinfEngine concrSlabRequiredReinfEngine;

            concrSlabRequiredReinfEngine = concrCalcEngine.SlabRequiredReinf;
            RConcrSlabRequiredReinfCalcParams slabRnfParams;

            slabRnfParams        = concrSlabRequiredReinfEngine.Params;
            slabRnfParams.Method = IRobotReinforceCalcMethods.I_RCM_WOOD_ARMER;
            slabRnfParams.GloballyAvgDesginForces = false;
            slabRnfParams.ForcesReduction         = false;
            slabRnfParams.DisplayErrors           = false;
            slabRnfParams.CasesULS.FromText("1 2 3 4 5 6 7 8");
            RobotSelection slabs;

            slabs = slabRnfParams.Panels;
            slabs.FromText(System.Convert.ToString(ObjNumber));
            string SlabReinforcementName = "Slab X";

            label = labels.Create(IRobotLabelType.I_LT_PANEL_REINFORCEMENT, SlabReinforcementName);
            labels.Store(label);
            slab.SetLabel(IRobotLabelType.I_LT_PANEL_REINFORCEMENT, SlabReinforcementName);
            slab.Update();
            this.Activate();
            if (!concrSlabRequiredReinfEngine.Calculate())
            {
                MessageBox.Show("Calculation Failed!", "Concrete Calculations");
            }
            else
            {
                MessageBox.Show("Done!", "Concrete Calculations");
            }
            //getting results My and Yz for beam (bar 5) with live load (case 2)
            //获取单元5的内力
            string txt;

            txt = "Bar 5, Live at 0.5 length:" + "\n\r" +
                  " My = " + str.Results.Bars.Forces.Value(5, 2, 0.5).MY / 1000 + " [kN*m]" + "\n\r" +
                  " Qz = " + -str.Results.Bars.Deflections.Value(5, 2, 0.5).UZ * 1000 + " [mm]" + "\n\r" + " Fz1 = " + str.Results.Bars.Forces.Value(5, 2, 0).FZ / 1000 + " [kN]" + "\n\r" +
                  " Fz2 = " + str.Results.Bars.Forces.Value(5, 2, 1).FZ / 1000 + " [kN]" + "\n\r";
            //getting results Fx and Fy for column (bar 4) with wind load (case 3)
            //获取单元4的内力
            txt += "Bar 4, Wind:" + "\n\r" +
                   " Fx = " + str.Results.Bars.Forces.Value(4, 3, 1).FX / 1000 + " [kN]" + "\n\r" +
                   " Fy = " + str.Results.Bars.Forces.Value(4, 3, 1).FY / 1000 + " [kN]" + "\n\r";
            //getting results Fx, Fy, Fz, Mx, My, Mz for foot (node 1) with self-weight (case 1)
            //节点1内力
            txt += "Node 1, Self-Weight:" + "\n\r" +
                   " Fx = " + str.Results.Nodes.Reactions.Value(1, 1).FX / 1000 + " [kN]" + "\n\r" +
                   " Fy = " + str.Results.Nodes.Reactions.Value(1, 1).FY / 1000 + " [kN]" + "\n\r" +
                   " Fz = " + str.Results.Nodes.Reactions.Value(1, 1).FZ / 1000 + " [kN]" + "\n\r" +
                   " Mx = " + str.Results.Nodes.Reactions.Value(1, 1).MX / 1000 + " [kN]" + "\n\r" +
                   " My = " + str.Results.Nodes.Reactions.Value(1, 1).MY / 1000 + " [kN]" + "\n\r" +
                   " Mz = " + str.Results.Nodes.Reactions.Value(1, 1).MZ / 1000 + " [kN]" + "\n\r";
            //getting results Ax+, Ax-, Ay+, Ay- for slab
            //获取板单元的内力
            RobotSelection SelectionFE;

            SelectionFE = str.Selections.Get(IRobotObjectType.I_OT_FINITE_ELEMENT);
            SelectionFE.FromText(slab.FiniteElems);
            RobotLabelCollection ObjFEs;

            ObjFEs = (RobotLabelCollection)str.FiniteElems.GetMany(SelectionFE);
            double AxP;
            double AxM;
            double AyP;
            double AyM;
            double A;

            A   = 0;
            AxP = 0;
            AxM = 0;
            AyP = 0;
            AyM = 0;
            RobotFiniteElement FE;

            for (int n = 1; n <= ObjFEs.Count; n++)
            {
                FE = (RobotFiniteElement)ObjFEs.Get(n);
                A  = str.Results.FiniteElems.Reinforcement(slab.Number, FE.Number).AX_BOTTOM;
                if (A > AxM)
                {
                    AxM = A;
                }
                A = str.Results.FiniteElems.Reinforcement(slab.Number, FE.Number).AX_TOP;
                if (A > AxP)
                {
                    AxP = A;
                }
                A = str.Results.FiniteElems.Reinforcement(slab.Number, FE.Number).AY_BOTTOM;
                if (A > AyM)
                {
                    AyM = A;
                }
                A = str.Results.FiniteElems.Reinforcement(slab.Number, FE.Number).AY_TOP;
                if (A > AyP)
                {
                    AyP = A;
                }
            }
            //getting results Fx, Fy, Fz, Mx, My, Mz for foot (node 1) with self-weight (case 1)
            //求结点的反力
            txt += "Slab 1, Reinforcemet extreme values:" + "\n\r" +
                   " Ax+ = " + AxP * 10000 + " [cm2]" + "\n\r" +
                   " Ax- = " + AxM * 10000 + " [cm2]" + "\n\r" +
                   " Ay+ = " + AyP * 10000 + " [cm2]" + "\n\r" +
                   " Ay- = " + AyM * 10000 + " [cm2]" + "\n\r";
            this.Activate();
            MessageBox.Show(txt, "Results");
        }