0

I wrote an external command that creates detail views for doors, windows, etc and puts each object in a separate sheet.

Sometimes the new sheets are zoomed-out by default (the yellow circle shows the actual sheet). I guess it has to do with the witness lines (in the blue circle).

Sheet zoomed out

I tried activating the views and then found their uiView and used the zoom methods but they don't seem to make a difference (possibly because they work in model coordinates and not in sheet outline coordinates).

uv.ZoomToFit();

Manual zoom-to-fit works fine. Also, the sheet's outline property is correct (not too large).

Any ideas?

Thanks!

EyalS
  • 1

1 Answers1

1

You can use the ShowElements method to zoom to an element. That does the same as zoom-to-fit to a specific set of elements. The element may possibly also be the sheet itself.

The Building Coder discusses how that can also be used to Switch View or Document.

Also, look at displaying a text file from a TaskDialog command link.

Jeremy Tammik
  • 7,333
  • 2
  • 12
  • 17
  • Thanks! If I understand correctly, ShowElements would also switch to the new sheet, which isn't what I'm looking for (as I create a bunch of sheets and I don't want to show them all). I figured I'd do it using the OnViewActivated event when a new sheet is displayed. This works well. Thanks! – EyalS May 28 '19 at 16:41