/// <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 }); }
/// <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); }
public static ElevationMarker Wrap(Autodesk.Revit.DB.ElevationMarker ele, bool isRevitOwned) { return(ElevationMarker.FromExisting(ele, isRevitOwned)); }
/// <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; }
/// <summary> /// Initialize a ElevationMarker element /// </summary> private void InitElevationMarker(Autodesk.Revit.DB.ElevationMarker marker) { InternalSetElevationMarker(marker); }
/// <summary> /// Private constructor /// </summary> private ElevationMarker(Autodesk.Revit.DB.ElevationMarker marker) { SafeInit(() => InitElevationMarker(marker)); }