Author Topic: In Revit how do you locate a Viewport in the center of a Sheet  (Read 1678 times)

0 Members and 1 Guest are viewing this topic.

MexicanCustard

  • Swamp Rat
  • Posts: 705
I've tried setting the Viewport's SetBoxCenter to the center of the the Sheet's Outline.  This always puts the Viewport in, offset from the center of the sheet.  The numbers I get back from the Viewport's boundary don't seem to correlate to either the actual dimensions of the sheet, the actual dimensions of the model, or the model dimensions scaled by the Sheets scale.  Can someone point me in the right direction on locating the Viewport in the center of the Sheet?
Revit 2019, AMEP 2019 64bit Win 10

ChrisCarlson

  • Guest
Re: In Revit how do you locate a Viewport in the center of a Sheet
« Reply #1 on: April 08, 2016, 10:28:39 AM »
Is it not finding the center of the view or center of the sheet?

If it's not finding the center of the view what if you take a min/max bounding box?
Code - C#: [Select]
  1. XYZ xyzPosition = ( xyzLocation.Max + xyzLocation.Min ) / 2.0;



MexicanCustard

  • Swamp Rat
  • Posts: 705
Re: In Revit how do you locate a Viewport in the center of a Sheet
« Reply #2 on: April 08, 2016, 01:05:15 PM »
The view coordinates are good. I can get the boundingbox and the center and the results are as expected.  The min to max distance will give me the 30x42 titleblock I have.

If I do the same with the viewport I get 9'x18' roughly and the center of that doesn't seem to be in the views coordinates.  I don't know where those distances are coming from since the model dimensions are hundreds of feet and those distance scaled by 48 are the same as my 30x42 title block.   I'm guessing there is some kind of conversion I need to do between the size of the viewport and the sheet coordinates.
Revit 2019, AMEP 2019 64bit Win 10

ChrisCarlson

  • Guest
Re: In Revit how do you locate a Viewport in the center of a Sheet
« Reply #3 on: April 08, 2016, 01:29:27 PM »