Named View from Rectangle .NET

Named View from Rectangle .NET

hippe013
Advisor Advisor
453 Views
1 Reply
Message 1 of 2

Named View from Rectangle .NET

hippe013
Advisor
Advisor

I have been struggling trying to get this to work properly. 

I would like to do the following: 

Have the user select a polyline, polyline is a rectangle and may be rotated (must be closed and contain only 4 points);

Determine the upper left & right, and the lower left & right (as the corners of the polyline, not the bounding box);

Create a ucs where origin = LowerLeft, xAxis = LowerLeft to LowerRight, yAxis = LowerLeft to UpperLeft

Create a named view aligned to the rotation of the polyline and bound by the dimensions of the polyline.

 

I am struggling with the center point of the named view and the twist or rotation. Any help is greatly appreciated.

 

0 Likes
454 Views
1 Reply
Reply (1)
Message 2 of 2

JamieVJohnson2
Collaborator
Collaborator

Views are like cameras, their calculations are about center (target of camera), and zoom (distance from target).  If you want to turn a pline box into a view, you will need to calc the center of the pline, the rotation of the pline, and use the size of the pline to calculated the distance from target and get a proper zoom.  The latter being the more complicated, you will want to get the size of the viewport in pixels, compare to the size of the plinebox and set.

Non numerically, you can set a view to the center of the plinebox, rotate, then zoom to fit box.

Jamie Johnson : Owner / Sisu Lissom, LLC https://sisulissom.com/
0 Likes