/// <summary> /// Returns the database objects with the given ObjectIds. /// </summary> /// <typeparam name="T">The type of the objects.</typeparam> /// <param name="ids">The ids of the objects.</param> /// <param name="forWrite">True, if the objects should be opened for-write.</param> /// <exception cref="System.ArgumentNullException">Thrown when parameter <i>ids</i> is null.</exception> /// <exception cref="System.InvalidCastException">Thrown when an object cannot be casted to the target type.</exception> /// <exception cref="System.Exception">Thrown when an ObjectId is invalid or getting an element throws an exception.</exception> /// <returns>The objects with the given ObjectIds.</returns> public IEnumerable <T> Elements <T>(IEnumerable <ObjectId> ids, bool forWrite) where T : DBObject { Require.NotDisposed(Database.IsDisposed, nameof(AcadDatabase)); Require.ElementsValid(ids, nameof(ids)); return(ElementsInternal <T>(ids, forWrite)); }
/// <summary> /// Returns the database objects with the given ObjectIds. /// </summary> /// <typeparam name="T">The type of the objects.</typeparam> /// <param name="ids">The ids of the objects.</param> /// <param name="forWrite">True, if the objects should be opened for-write.</param> /// <exception cref="System.ArgumentNullException">Thrown when parameter <i>ids</i> is null.</exception> /// <exception cref="System.InvalidCastException">Thrown when an object cannot be casted to the target type.</exception> /// <exception cref="System.Exception">Thrown when an ObjectId is invalid or getting an element throws an exception.</exception> /// <returns>The objects with the given ObjectIds.</returns> public IEnumerable <T> Elements <T>(ObjectIdCollection ids, bool forWrite) where T : DBObject { Require.NotDisposed(Database.IsDisposed, nameof(AcadDatabase)); Require.ParameterNotNull(ids, nameof(ids)); Require.ElementsValid(ids.Cast <ObjectId>(), nameof(ids)); return(ElementsInternal <T>(ids.Cast <ObjectId>(), forWrite)); }