Esempio n. 1
0
 /// <summary>
 /// Create a View from a user selected Element.
 /// </summary>
 /// <param name="view"></param>
 /// <param name="isRevitOwned"></param>
 /// <returns></returns>
 internal static SectionView FromExisting(Autodesk.Revit.DB.ViewSection view, bool isRevitOwned)
 {
     return(new SectionView(view)
     {
         IsRevitOwned = isRevitOwned
     });
 }
Esempio n. 2
0
        /// <summary>
        /// Creates a new elevation ViewSection on the ElevationMarker at the desired index.
        /// </summary>
        /// <param name="planView">The PlanView in which the ElevationMarker is visible. The new elevation ViewSection will derive its extents and inherit settings from the ViewPlan.</param>
        /// <param name="index">The index on the ElevationMarker where the new elevation ViewSection will be placed. The elevation marker can have up to four views, indexed from 0 to 3.</param>
        /// <returns>The new elevation ViewSection.</returns>
        public SectionView CreateElevationByMarkerIndex(Revit.Elements.Views.View planView, int index)
        {
            var view = planView as PlanView;

            if (view == null)
            {
                throw new InvalidOperationException(Properties.Resources.NotPlanView);
            }

            TransactionManager.Instance.EnsureInTransaction(Document);
            Autodesk.Revit.DB.ViewSection sectionView = this.InternalMarker.CreateElevation(Document, view.InternalViewPlan.Id, index);
            TransactionManager.Instance.TransactionTaskDone();
            return(sectionView.ToDSType(true) as SectionView);
        }
Esempio n. 3
0
 public static SectionView Wrap(Autodesk.Revit.DB.ViewSection view, bool isRevitOwned)
 {
     return(SectionView.FromExisting(view, isRevitOwned));
 }
Esempio n. 4
0
 /// <summary>
 /// Set the InternalViewSection property and the associated element id and unique id
 /// </summary>
 /// <param name="floor"></param>
 private void InternalSetSectionView(Autodesk.Revit.DB.ViewSection floor)
 {
     this.InternalViewSection = floor;
     this.InternalElementId   = floor.Id;
     this.InternalUniqueId    = floor.UniqueId;
 }
Esempio n. 5
0
 /// <summary>
 /// Private constructor
 /// </summary>
 private SectionView(Autodesk.Revit.DB.ViewSection view)
 {
     InternalSetSectionView(view);
 }
Esempio n. 6
0
 /// <summary>
 /// Private constructor
 /// </summary>
 private SectionView(Autodesk.Revit.DB.ViewSection view)
 {
     SafeInit(() => InitSectionView(view));
 }