Exemple #1
0
        /// <summary>
        /// Create a new Sheet Selection Set.
        /// </summary>
        /// <param name="sheetSet">The Sheet Set to contain the Selection Set.</param>
        /// <param name="name">The name of the Sheet Selection Set.</param>
        /// <returns>The new Sheet Selection Set.</returns>
        public static SheetSelectionSet BySheetSetAndName(SheetSet sheetSet, string name)
        {
            AcSmSheetSelSet newSelSet = null;

            sheetSet.BaseObject.GetSheetSelSets().Add(name, name, ref newSelSet);
            return(new SheetSelectionSet(newSelSet));
        }
Exemple #2
0
        /// <summary>
        /// Get a custom property from the sheet set
        /// </summary>
        /// <param name="sheetSet">The Sheet Set to search.</param>
        /// <param name="propertyName">The name to look for.</param>
        /// <returns>The Custom Property.</returns>
        public static CustomProperty ByName(SheetSet sheetSet, string propertyName)
        {
            CustomProperty          retVal    = null;
            AcSmCustomPropertyValue propValue = sheetSet.BaseObject.GetCustomPropertyBag().GetProperty(propertyName);

            retVal = new CustomProperty(propertyName, propValue.GetValue(), (int)propValue.GetFlags());
            return(retVal);
        }
        public SheetSet GetParentSheetSet(string filename, string layoutname)
        {
            IAcSmSheetSetMgr ssMgr = new AcSmSheetSetMgr();
            AcSmSheetSet     sheetSet;

            ssMgr.GetParentSheetSet(filename, layoutname, out sheetSet);
            SheetSet output = new SheetSet(sheetSet);

            return(output);
        }
Exemple #4
0
 /// <summary>
 /// Get an existing sheet in the set.
 /// </summary>
 /// <param name="sheetSet">Sheet Set to access.</param>
 /// <param name="index">Index number of the sheet to get.</param>
 /// <returns>Sheet object.</returns>
 public static Sheet BySheetSetIndex(SheetSet sheetSet, int index)
 {
     if (sheetSet != null)
     {
         return(sheetSet.Sheets[index]);
     }
     else
     {
         return(null);
     }
 }
Exemple #5
0
 /// <summary>
 /// Get an existing Sheet Selection Set by index.
 /// </summary>
 /// <param name="sheetSet">The containing Sheet Set.</param>
 /// <param name="index">The index number of the Selection Set.</param>
 /// <returns>The selected Sheet Selection Set.</returns>
 public static SheetSelectionSet BySheetSetIndex(SheetSet sheetSet, int index)
 {
     if ((sheetSet != null) && (index >= 0) && (index <= sheetSet.Sheets.Count))
     {
         return(sheetSet.SheetSelectionSets[index]);
     }
     else
     {
         return(null);
     }
 }
        public static Sheet AddNewSheet(SheetSet sheetSet, string name, string desc = "")
        {
            Sheet newSheet;

            if (sheetSet != null)
            {
                newSheet = sheetSet.AddNewSheet(name, desc);
                return(newSheet);
            }
            else
            {
                return(null);
            }
        }
Exemple #7
0
        /// <summary>
        /// Create and add a new Subset to the Sheet Set.
        /// </summary>
        /// <param name="sheetSet">The sheet set to contain the new subset.</param>
        /// <param name="name">The name of the new subset.</param>
        /// <param name="description">The optional description of the new subset.</param>
        /// <param name="newSheetDWTLayout">The optional layout tab of an alterante DWT to create new sheets from.</param>
        /// <param name="newSheetDWTLocation">The optional location of an alternate DWT to create new sheets from.</param>
        /// <param name="newSheetLocation">An optional new location to create new sheets for this subset.</param>
        /// <param name="promptForDWT">Optional setting to force the user to select a template with each new sheet.</param>
        /// <returns>The new subset.</returns>
        public static SubSet CreateNewSubset(SheetSet sheetSet, string name, string description = "", string newSheetLocation = "", string newSheetDWTLocation = "", string newSheetDWTLayout = "", bool promptForDWT = false)
        {
            SubSet retVal = null;

            if ((sheetSet != null) || (name != null) || (name != ""))
            {
                try
                {// lock the database
                    if (Database.LockDatabase(sheetSet.Database, true))
                    {
                        //create the new subset
                        AcSmSubset newSubset = (AcSmSubset)sheetSet.BaseObject.CreateSubset(name, description);
                        // get thet folder the sheet set is stored in
                        IAcSmFileReference sheetSetFolder = sheetSet.BaseObject.GetNewSheetLocation();

                        // create a file reference
                        IAcSmFileReference fileReference = newSubset.GetNewSheetLocation();
                        // check if a new path was provided, if not, default to the sheet set location
                        if (newSheetLocation != "")
                        {
                            fileReference.SetFileName(newSheetLocation);
                        }
                        else
                        {
                            fileReference.SetFileName(sheetSetFolder.GetFileName());
                        }
                        // set the location for new sheets added to the subset
                        newSubset.SetNewSheetLocation(fileReference);

                        // check if a default DWT location and name was provided
                        if ((newSheetDWTLocation != "") && (newSheetDWTLayout != ""))
                        {
                            // create a reference to a layout reference object
                            AcSmAcDbLayoutReference layoutReference = newSubset.GetDefDwtLayout();
                            layoutReference.SetFileName(newSheetDWTLocation);
                            layoutReference.SetName(newSheetDWTLayout);
                            // set the layout reference for the subset
                            newSubset.SetDefDwtLayout(layoutReference);
                        }

                        // set the prompt for template option
                        newSubset.SetPromptForDwt(promptForDWT);

                        // create our version of a subset
                        retVal = new SubSet((AcSmSubset)newSubset);
                    }
                    // if it couldn't be locked, fail
                    else
                    {
                        return(null);
                    }
                }
                catch (Exception ex)
                { Debug.WriteLine(ex.Message); }
                finally
                {
                    // unlock the database
                    Database.LockDatabase(sheetSet.Database, false);
                }
            }
            return(retVal);
        }
 public static bool GetIsDirty(SheetSet sheetSet)
 {
     throw new NotImplementedException();
 }