コード例 #1
0
ファイル: Model.Tests.cs プロジェクト: songcn206/OpenStudio
        public void BasicModel()
        {
            // Console.WriteLine("\nCreate an empty model and add 2 Spaces");

            OpenStudio.Model model = new OpenStudio.Model();

            OpenStudio.Space space1 = new OpenStudio.Space(model);
            space1.setName("First Space");
            OpenStudio.Space space2 = new OpenStudio.Space(model);
            space2.setName("Second Space");

            OpenStudio.SpaceVector spaces = model.getSpaces();
            var spaceArray = spaces.ToArray();

            Assert.Equal(2, spaceArray.Length);

            Assert.True(Array.Exists(spaceArray, s => (s.nameString() == "First Space")));
            Assert.True(Array.Exists(spaceArray, s => (s.nameString() == "Second Space")));
        }
コード例 #2
0
        static void createAFewSpaces()
        {
            Console.WriteLine("\nCreate an empty model and add 2 Spaces");

            OpenStudio.Model model = new OpenStudio.Model();

            OpenStudio.Space space1 = new OpenStudio.Space(model);
            space1.setName("First Space");
            OpenStudio.Space space2 = new OpenStudio.Space(model);
            space2.setName("Second Space");

            OpenStudio.SpaceVector spaces = model.getSpaces();
            var spaceArray = spaces.ToArray();


            Console.WriteLine("The model has " + spaceArray.Length + " Spaces:");
            for (int i = 0; i < spaceArray.Length; ++i)
            {
                Console.WriteLine("* {0}.", spaceArray[i].nameString());
            }
        }