I’m trying to place elevation markers.
Works beautifully for the ground floor…
But any other floor it plonks them on the ground floor.
I cannot get them to place on any other floor! Why?
I’ve even tried hard coding my first floor height in! But it still puts them on the ground floor.
//Places an elevation marker and creates 4 views. Logs the 4 views in a list.
public static List<ViewSection> CreateElevationViewsAtPoint(
Document doc, View planView, XYZ location, ElementId elevationTypeId, int markerSize = 100)
{
XYZ loc = new XYZ(0, 0, UnitUtils.ConvertToInternalUnits(3000, UnitTypeId.Millimeters)); //test Z coord
ElevationMarker marker = ElevationMarker.CreateElevationMarker(doc, elevationTypeId, loc, markerSize);
if (marker == null)
return new List<ViewSection>();
int[] desiredOrder = { 1, 2, 3, 0 };
var views = new List<ViewSection>();
foreach (int dir in desiredOrder)
{
try
{
ViewSection view = marker.CreateElevation(doc, planView.Id, dir);
if (view != null)
views.Add(view);
}
catch
{
// probably should add something here...
}
}
return views;
}
calling it like this
List<ViewSection> views = HelpersRevitViews.CreateElevationViewsAtPoint(doc, activeView, point, elevationTypeId);
doc and active view are correct (checked 1000x)
point I’m getting from base of room (yes I’ve checked the Z but as you see above I even hard coded it).
Any ideas?