Пример #1
0
        private void OnObjectErased(object sender, _OdDb.ObjectErasedEventArgs e)
        {
            var obj  = e.DBObject;
            var ghId = _OdDb.ObjectId.Null;

            if (obj is GrasshopperData)
            {
                ghId = obj.ObjectId;
            }
            else if (obj is _OdDb.Entity ent)
            {
                ghId = GrasshopperData.GetGrasshopperData(ent);
            }

            if (!ghId.IsNull)
            {
                if (obj.IsErased)
                {
                    _grasshopperData.Remove(obj.ObjectId);
                }
                else
                {
                    _toUpdate.Add(obj.ObjectId);
                }
            }
        }
Пример #2
0
        static void OnObjectErased(object sender, _OdDb.ObjectErasedEventArgs e)
        {
            var obj = e.DBObject;

            (obj.IsErased ? _erased : _appended).Add(e.DBObject.ObjectId.Handle);
        }