Beispiel #1
0
        private void OnObjectModified(object sender, _OdDb.ObjectEventArgs e)
        {
            var objId = e.DBObject.ObjectId;

            if (objId.ObjectClass.IsDerivedFrom(_OdRx.RXObject.GetClass(typeof(GrasshopperData))))
            {
                _toUpdate.Add(objId);
            }
            else if (e.DBObject is _OdDb.Entity ent)
            {
                var id = GrasshopperData.GetGrasshopperData(ent);
                if (!id.IsNull)
                {
                    _toUpdate.Add(id);
                }
            }
            else if (e.DBObject is _OdDb.BlockTableRecord btr)
            {
                foreach (_OdDb.ObjectId refId in btr.GetBlockReferenceIds(true, false))
                {
                    using (var blockRef = refId.GetObject(_OdDb.OpenMode.ForRead) as _OdDb.Entity)
                    {
                        var id = GrasshopperData.GetGrasshopperData(blockRef);
                        if (!id.IsNull)
                        {
                            _toUpdate.Add(id);
                        }
                    }
                }
            }
        }
Beispiel #2
0
        static void OnObjectModified(object sender, _OdDb.ObjectEventArgs e)
        {
            var objId = e.DBObject.ObjectId;

            if (objId.ObjectClass.IsDerivedFrom(_OdRx.RXObject.GetClass(typeof(_OdDb.Entity))))
            {
                _modified.Add(e.DBObject.ObjectId.Handle);
            }
        }