Element coordinate on VIewSheet

Element coordinate on VIewSheet

Anonymous
Not applicable
1,576 Views
3 Replies
Message 1 of 4

Element coordinate on VIewSheet

Anonymous
Not applicable

Hi,

I have a revit document with views and viewsheet. Viewsheet (named them S1) contains two view (V1 and V2). View can include :

1. Building Elevation, four, on each side. (North, south, etc), OST_Viewers category type

2. Section, OST_Viewers category type

3. Levels, OST_Levels category type/

I print S1,V1,V2 to one PDF file and want place local links on it (in pdf file) to navigate from S1 page to V1 and V2 page. 

How can i find elements coordinates, from this three groups (Elevation, Section, Levels) on S1.

For Example  V1  include Level L1, S1 (A4 format) contain V1. Coordinate for L1 is 100 mm on X and 50mm on Y. So i can use this coordinates to place marks in PDF file.

 

Thanks in advance

 

P.S. In draw what i want in a part of Revit document screenshot, hope this helps.

 

P.S.S. Sorry for bad english

 

 

0 Likes
1,577 Views
3 Replies
Replies (3)
Message 2 of 4

Joe.Ye
Alumni
Alumni

 

Each view in the view sheet is represented by ViewPort class. You can get the ViewPort outline by ViewPort.GetBoxOutline() method. From the returned Outline object, you can get the box's Max and Min point coordinates by Outline.MaximumPoint and Outline.MinimumPoint.

 

So you can get each corner's coordinates and also the center point of the box by (max+min)/2.0.

 

Hope this helps.



Joe Ye
Contractor
Developer Technical Services
Autodesk Developer Network
0 Likes
Message 3 of 4

Anonymous
Not applicable

Thanks for Reply.  I can check this only now. 

 

But i still find that getBoxOutline returns, in min and max, vectors. Same coords i get when use GetBoundingBox.But How i can transfrom them to normal coordinates? This is the question. Maybe i did't explain that in my previous post. 

 

Maybe i need some transformation from vector coordinates to normal, window, coordinates in pixels

0 Likes
Message 4 of 4

Joe.Ye
Alumni
Alumni

 

Revit 2013 provided the UIView to represent each Revit view. UIView.GetWindowRectangle returns the drawing area coordinates of views. 

Through the windows API, you can get this view's drawing area windows coordinates.

Then build the relationship of the vector coordinates system and the windows screen coordinate system.

 

Jeremy posted a very nice post on how to show customized tips when cursor hover Revit elemets. I think this article should covered the coordinates transform.

 

http://thebuildingcoder.typepad.com/blog/2012/10/uiview-windows-coordinates-referenceintersector-and...

 

Hope this helps.



Joe Ye
Contractor
Developer Technical Services
Autodesk Developer Network
0 Likes