Exemplo n.º 1
0
        internal string CreateIOMTst()
        {
            CreateIDEAOpenModel();

            AddMaterialsToOpenModel();

            AddCrossSectionToOpenModel();

            AddNodesToOpenModel();

            CreateIDEAOpenModelConnection();



            AddLoadCasesToOpenModel();

            AddCombinationToOpenModel();

            CreateIDEAOpenModelResults();



            //RAZ: Filepath locatie toewijzen
            string strFil = @"C:\Data\test_k_joint";

            //if (result == true)

            openStructModel.SaveToXmlFile(strFil);
            openStructModelR.SaveToXmlFile(strFil + "r");
            //return saveFileDialog.FileName;

            return(strFil);
        }
Exemplo n.º 2
0
        internal string CreateIOMTst()
        {
            CreateIDEAOpenModel();

            AddMaterialsToOpenModel();

            AddCrossSectionToOpenModel();

            AddNodesToOpenModel();

            CreateIDEAOpenModelConnection();

            AddLoadCasesToOpenModel();

            AddCombinationToOpenModel();

            CreateIDEAOpenModelResults();

            SaveFileDialog saveFileDialog = new SaveFileDialog();

            saveFileDialog.DefaultExt = "*.xml";
            saveFileDialog.Filter     = "xml soubor (*.xml)|*.xml";
            saveFileDialog.Title      = string.Format("Name of file");
            bool?result = saveFileDialog.ShowDialog();

            if (result == true)
            {
                openStructModel.SaveToXmlFile(saveFileDialog.FileName);
                openStructModelR.SaveToXmlFile(saveFileDialog.FileName + "r");
                return(saveFileDialog.FileName);
            }

            return(null);
        }
Exemplo n.º 3
0
        public static void Main(string[] args)
        {
            IdeaInstallDir = IOM.SteelFrameDesktop.Properties.Settings.Default.IdeaInstallDir;

            if (!Directory.Exists(IdeaInstallDir))
            {
                Console.WriteLine("IDEA StatiCa installation was not found in '{0}'", IdeaInstallDir);
                return;
            }

            Console.WriteLine("IDEA StatiCa installation directory is '{0}'", IdeaInstallDir);

            Console.WriteLine("Start generate example of IOM...");

            // create IOM and results
            OpenModel       example = SteelFrameExample.CreateIOM();
            OpenModelResult result  = Helpers.GetResults();

            string iomFileName    = "example.xml";
            string iomResFileName = "example.xmlR";

            // save to the files
            example.SaveToXmlFile(iomFileName);
            result.SaveToXmlFile(iomResFileName);


            var desktopDir = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
            var fileConnFileNameFromLocal = Path.Combine(desktopDir, "connectionFromIOM-local.ideaCon");

            var calcFactory = new ConnHiddenClientFactory(IdeaInstallDir);

            var client = calcFactory.Create();

            try
            {
                // it creates connection project from IOM
                Console.WriteLine("Creating Idea connection project ");
                client.CreateConProjFromIOM(iomFileName, iomResFileName, fileConnFileNameFromLocal);
                Console.WriteLine("Generated project was saved to the file '{0}'", fileConnFileNameFromLocal);
            }
            catch (Exception e)
            {
                Console.WriteLine("Error '{0}'", e.Message);
            }
            finally
            {
                if (client != null)
                {
                    client.Close();
                }
            }

            // end console application
            Console.WriteLine("Done. Press any key to exit.");
            Console.ReadKey();
        }
Exemplo n.º 4
0
        public static void Main(string[] args)
        {
            IdeaInstallDir = IOM.SteelFrameDesktop.Properties.Settings.Default.IdeaInstallDir;

            Console.WriteLine("IDEA StatiCa installation directory is '{0}'", IdeaInstallDir);

            AppDomain currentDomain = AppDomain.CurrentDomain;

            currentDomain.AssemblyResolve += new ResolveEventHandler(IdeaResolveEventHandler);

            Console.WriteLine("Start generate example of IOM...");

            // create IOM and results
            OpenModel       example = Example.CreateIOM();
            OpenModelResult result  = Helpers.GetResults();

            // save to the files
            result.SaveToXmlFile("example.xmlR");
            example.SaveToXmlFile("example.xml");

            var desktopDir = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
            var fileConnFileNameFromLocal = Path.Combine(desktopDir, "connectionFromIOM-local.ideaCon");

            string  ideaConLinkFullPath = System.IO.Path.Combine(IdeaInstallDir, "IdeaStatiCa.IOMToConnection.dll");
            var     conLinkAssembly     = Assembly.LoadFrom(ideaConLinkFullPath);
            object  obj = conLinkAssembly.CreateInstance("IdeaStatiCa.IOMToConnection.IOMToConnection");
            dynamic d   = obj;

            // Initializtion
            var initMethod = (obj).GetType().GetMethod("Init");

            initMethod.Invoke(obj, null);

            Console.WriteLine("Generating IDEA Connection project locally");

            // Invoking method Import by reflection
            var methodImport = (obj).GetType().GetMethod("Import");

            object[] array = new object[3];
            array[0] = example;
            array[1] = result;
            array[2] = fileConnFileNameFromLocal;
            methodImport.Invoke(obj, array);

            Console.WriteLine("Writing Idea connection project to file '{0}'", fileConnFileNameFromLocal);

            // end console application
            Console.WriteLine("Done. Press any key to exit.");
            Console.ReadKey();
        }
Exemplo n.º 5
0
        //Project project2 = new Project("Projectname");
        //project2 = Project.ReadProjectFromXML(@"C:\Data\\ElementRAZ88");



        public string CreateIOMTst()
        {
            //Project project2 = new Project();
            //project2 = Project.ReadProjectFromXML(@"C:\Data\\ElementRAZ88");


            CreateIDEAOpenModel();



            AddMaterialsToOpenModel();

            AddCrossSectionToOpenModel();

            AddNodesToOpenModel();

            CreateIDEAOpenModelConnection();



            AddLoadCasesToOpenModel();

            AddCombinationToOpenModel();

            CreateIDEAOpenModelResults();


            //RAZ: Filepath locatie toewijzen
            string strFil = @"C:\Data\test_k_joint";

            //if (result == true)

            openStructModel.SaveToXmlFile(strFil);
            openStructModelR.SaveToXmlFile(strFil + "r");
            //return saveFileDialog.FileName;

            return(strFil);
        }
Exemplo n.º 6
0
        public static void Main(string[] args)
        {
            Console.WriteLine("Start generate example of IOM...");

            // create IOM and results
            OpenModel       example = Example.CreateIOM();
            OpenModelResult result  = Helpers.GetResults();

            // save to the files
            result.SaveToXmlFile("example.xmlR");
            example.SaveToXmlFile("example.xml");

            var desktopDir = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);

            #region Generatig IDEA Connection by web service
            Console.WriteLine("Generating IDEA Connection project by web service");
            var fileConnFileNameFromWeb = Path.Combine(desktopDir, "connectionFromIOM-web.ideaCon");
            Example.CreateOnServer(example, result, fileConnFileNameFromWeb);
            #endregion

            // end console application
            Console.WriteLine("Done. Press any key to exit.");
            Console.ReadKey();
        }
Exemplo n.º 7
0
        public static void Main(string[] args)
        {
            IdeaInstallDir = IOM.SteelFrameDesktop.Properties.Settings.Default.IdeaInstallDir;

            if (!Directory.Exists(IdeaInstallDir))
            {
                Console.WriteLine("IDEA StatiCa installation was not found in '{0}'", IdeaInstallDir);
                return;
            }

            Console.WriteLine("IDEA StatiCa installation directory is '{0}'", IdeaInstallDir);

            Console.WriteLine("Select the required example");
            Console.WriteLine("1  - Steel frame ECEN");
            Console.WriteLine("2  - Simple frame AUS");

            var option = Console.ReadLine();

            OpenModel       iom       = null;
            OpenModelResult iomResult = null;

            if (option.Equals("2", StringComparison.InvariantCultureIgnoreCase))
            {
                Console.WriteLine("Generating Australian steel frame ...");

                // create IOM and results
                iom       = SimpleFrameAUS.CreateIOM();
                iomResult = null;
            }
            else
            {
                Console.WriteLine("Generating ECEN steel frame ...");

                // create IOM and results
                iom       = SteelFrameExample.CreateIOM();
                iomResult = Helpers.GetResults();
            }

            string iomFileName    = "example.xml";
            string iomResFileName = "example.xmlR";

            // save to the files
            iom.SaveToXmlFile(iomFileName);

            if (iomResult != null)
            {
                iomResult.SaveToXmlFile(iomResFileName);
            }
            else
            {
                iomResFileName = string.Empty;
            }

            var desktopDir = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
            var fileConnFileNameFromLocal = Path.Combine(desktopDir, "connectionFromIOM-local.ideaCon");

            var calcFactory = new ConnHiddenClientFactory(IdeaInstallDir);

            var client = calcFactory.Create();

            try
            {
                // it creates connection project from IOM
                Console.WriteLine("Creating Idea connection project ");
                client.CreateConProjFromIOM(iomFileName, iomResFileName, fileConnFileNameFromLocal);
                Console.WriteLine("Generated project was saved to the file '{0}'", fileConnFileNameFromLocal);
            }
            catch (Exception e)
            {
                Console.WriteLine("Error '{0}'", e.Message);
            }
            finally
            {
                if (client != null)
                {
                    client.Close();
                }
            }

            // end console application
            Console.WriteLine("Done. Press any key to exit.");
            Console.ReadKey();
        }