예제 #1
0
 /// <summary>
 /// Create a ElevationMarker from a user selected Element.
 /// </summary>
 /// <param name="marker"></param>
 /// <param name="isRevitOwned"></param>
 /// <returns></returns>
 internal static ElevationMarker FromExisting(Autodesk.Revit.DB.ElevationMarker marker, bool isRevitOwned)
 {
     return(new ElevationMarker(marker)
     {
         IsRevitOwned = isRevitOwned
     });
 }
예제 #2
0
        /// <summary>
        /// This node will add evelations on each side of the marker chosen. Typically 0-3.
        /// </summary>
        /// <param name="elevationMarker">The marker to host elevations on.</param>
        /// <param name="planView">Plan view to do this stuff to.</param>
        /// <param name="index">This is where the view appears.</param>
        /// <returns name="Result">The result</returns>
        /// <search>
        /// viewport, addview,rhythm
        /// </search>

        public static List <global::Revit.Elements.Element> CreateElevationByMarkerIndex(global::Revit.Elements.Element elevationMarker, global::Revit.Elements.Element planView, List <int> index)
        {
            Autodesk.Revit.DB.Document doc = DocumentManager.Instance.CurrentDBDocument;
            //obtain the element id from the sheet
            ElementId planViewId = planView.InternalElement.Id;
            List <global::Revit.Elements.Element> result = new List <global::Revit.Elements.Element>();

            foreach (int i in index)
            {
                Autodesk.Revit.DB.ElevationMarker internalMarker = (Autodesk.Revit.DB.ElevationMarker)elevationMarker.InternalElement;
                TransactionManager.Instance.EnsureInTransaction(doc);
                result.Add(internalMarker.CreateElevation(doc, planViewId, i).ToDSType(true));
                TransactionManager.Instance.TransactionTaskDone();
            }
            return(result);
        }
예제 #3
0
 public static ElevationMarker Wrap(Autodesk.Revit.DB.ElevationMarker ele, bool isRevitOwned)
 {
     return(ElevationMarker.FromExisting(ele, isRevitOwned));
 }
예제 #4
0
 /// <summary>
 /// Set the InternalMarker property and the associated element id and unique id
 /// </summary>
 /// <param name="marker"></param>
 private void InternalSetElevationMarker(Autodesk.Revit.DB.ElevationMarker marker)
 {
     InternalMarker    = marker;
     InternalElementId = marker.Id;
     InternalUniqueId  = marker.UniqueId;
 }
예제 #5
0
 /// <summary>
 /// Initialize a ElevationMarker element
 /// </summary>
 private void InitElevationMarker(Autodesk.Revit.DB.ElevationMarker marker)
 {
     InternalSetElevationMarker(marker);
 }
예제 #6
0
 /// <summary>
 /// Private constructor
 /// </summary>
 private ElevationMarker(Autodesk.Revit.DB.ElevationMarker marker)
 {
     SafeInit(() => InitElevationMarker(marker));
 }