コード例 #1
0
        //The ToNative() method is in the new schema conversion folder hierarchy

        public static SpeckleObject ToSpeckle(this GSAStorey dummyObject)
        {
            var newLines = ToSpeckleBase <GSAStorey>();
            var storeys  = new List <GSAStorey>();
            var keyword  = dummyObject.GetGSAKeyword();

            foreach (var k in newLines.Keys)
            {
                var storey = new GSAStorey()
                {
                    GWACommand = newLines[k]
                };
                try
                {
                    if (storey.ParseGWACommand())
                    {
                        storeys.Add(storey);
                    }
                }
                catch (Exception ex)
                {
                    Initialiser.AppResources.Messenger.Message(MessageIntent.TechnicalLog, MessageLevel.Error, ex,
                                                               "Keyword=" + keyword, "Index=" + k);
                }
            }

            if (storeys.Count() > 0)
            {
                Initialiser.GsaKit.GSASenderObjects.AddRange(storeys);
            }

            return((storeys.Count() > 0) ? new SpeckleObject() : new SpeckleNull());
        }
コード例 #2
0
        //The ToNative() method is in the new schema conversion folder hierarchy

        public static SpeckleObject ToSpeckle(this GSAStorey dummyObject)
        {
            var newLines = ToSpeckleBase <GSAStorey>();
            var typeName = dummyObject.GetType().Name;
            var storeys  = new List <GSAStorey>();

            foreach (var k in newLines.Keys)
            {
                var storey = new GSAStorey()
                {
                    GWACommand = newLines[k]
                };
                try
                {
                    if (storey.ParseGWACommand())
                    {
                        storeys.Add(storey);
                    }
                }
                catch (Exception ex)
                {
                    Initialiser.AppResources.Messenger.CacheMessage(MessageIntent.Display, MessageLevel.Error, typeName, k.ToString());
                    Initialiser.AppResources.Messenger.CacheMessage(MessageIntent.TechnicalLog, MessageLevel.Error, ex, typeName, k.ToString());
                }
            }

            Initialiser.GsaKit.GSASenderObjects.AddRange(storeys);

            return((storeys.Count() > 0) ? new SpeckleObject() : new SpeckleNull());
        }
コード例 #3
0
        public static SpeckleObject ToSpeckle(this GSAStorey dummyObject)
        {
            var newLines = ToSpeckleBase <GSAStorey>();

            var storeys = new List <GSAStorey>();

            foreach (var k in newLines.Keys)
            {
                var storey = new GSAStorey()
                {
                    GWACommand = newLines[k]
                };
                if (storey.ParseGWACommand())
                {
                    storeys.Add(storey);
                }
            }

            Initialiser.GSASenderObjects.AddRange(storeys);

            return((storeys.Count() > 0) ? new SpeckleObject() : new SpeckleNull());
        }