示例#1
0
        /// <summary>
        /// Provides access to the entities of the layout with the given tab index.
        /// </summary>
        /// <param name="index">The zero-based tab index of the layout.</param>
        /// <returns>An EntityContainer to access the layout's entities.</returns>
        public EntityContainer PaperSpace(int index)
        {
            var layouts = Layouts.ToArray();

            if (index < 0 || index >= layouts.Length)
            {
                throw Error.IndexOutOfRange("index", layouts.Length);
            }

            var blockId = Layouts.Where(l => !l.ModelType)
                          .OrderBy(l => l.TabOrder)
                          .ElementAt(index)
                          .BlockTableRecordId;

            try
            {
                return(new EntityContainer(Database, transaction, blockId));
            }
            catch (Exception e)
            {
                throw Error.AutoCadException(e);
            }
        }
示例#2
0
 public string[] GetLayouts(bool includeDefault)
 {
     return(Layouts.ToArray(typeof(string)) as string[]);
 }