Element.get_BoudingBox problem!


#1

I’m making a node duplicate view and place on new sheet, everything is ok but in the step place view on new sheet, i want to get the bounding box of origin view and set it for new view.

But i don’t know when i make python code, i have a problem with it. Why they don’t have attribute ??? When i use Node Geometry.BoundingBox everything is ok, but i want to use python code for my purpose. Please help me !!

7 8

 


#2

Still need help! Somebody else has python code for " Geometry.BoundingBox" node, i need to view for reference.


#3

Hello,

Are you trying to get the BB of a 2d view? If so, you might need to use view.Outline instead.

2015-07-15_09-47-03


#4

thanks Dimitar Venkov for reply, but i don’t know the result of function "Outline.Min or Outline.Max " ??

I need to get bounding box of view and then difine the center point of the view on a sheet, so i need to get the max and min of the bounding box.

Still need your help !!


#5

The view’s outline is similar to to a bounding box for 2d views. However it’s the paper space size, so you’ll need to scale it by the view’s scale. Once you do that, you should be able to get the average of the min and max XYZ.

http://revitapisearch.com/html/43a99f7c-6eb1-efb9-6aff-9540c434f8f2.htm