I cannot seem to get the location point of a schedule on a sheet.
I’ve put the origin in as a catch… and all the schedules are going to that point.
XYZ position = new XYZ(0, 0, 0); // Default position
// HOW do I get the location point of the schedule on the sheet???
LocationPoint locationPoint = scheduleInstance.Location as LocationPoint;
if (locationPoint != null)
{
position = locationPoint.Point; // XYZ coordinates of the schedule on the sheet
}
Are you sure you’re providing a ScheduleSheetInstance and not just a ScheduleView? It’s easy to grab the ScheduleView and forget about the placed instance.
LocationPoint locationPoint = scheduleInstance.Location as LocationPoint;
if (locationPoint != null)
{
position = locationPoint.Point;
}
Which I thought was getting the instance (apparently it wasn’t) …
Now doing this:
// Let's try a bounding box :D
BoundingBoxXYZ boundingBox = scheduleInstance.get_BoundingBox(originalSheet);
if (boundingBox != null)
{
// min point of bounding box
position = boundingBox.Min;
}
Which has, in my single test so far, worked. Yay!!!