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

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

            foreach (var k in newLines.Keys)
            {
                var p     = newLines[k];
                var plane = new GSAGridSurface()
                {
                    GWACommand = p, GSAId = k
                };
                try
                {
                    if (plane.ParseGWACommand())
                    {
                        planes.Add(plane);
                    }
                }
                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(planes);

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

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

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

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

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

            var planes = new List <GSAGridSurface>();

            foreach (var p in newLines.Values)
            {
                var plane = new GSAGridSurface()
                {
                    GWACommand = p
                };
                if (plane.ParseGWACommand())
                {
                    planes.Add(plane);
                }
            }

            Initialiser.GSASenderObjects.AddRange(planes);

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