I need to find the center point of a viewport in modelspace. I am looking for a vb.Net example but I can't seem to locate one.
Thanks in advance
Thanks for the response. I guess what I am looking for is a way to get the Modelspace centerpoint for each viewport in a layout without making the viewport or layout active. I have the viewports as a collection of object Ids. I was looking at the viewport viewcenter property. It seems to work for about 90% of our drawings but if someone has messed with the DView command the view center is off. I'm thinking there must be a way to use a transformation matrix to convert the DCS point to WCS
This seems to work. I hope I did it right
Dim ptCenter As Point3d = New Point3d(myVP.ViewCenter.X, myVP.ViewCenter.Y, 0) Dim transMatrx As Matrix3d transMatrx = Matrix3d.WorldToPlane(myVP.ViewDirection) transMatrx = Matrix3d.Displacement(myVP.ViewTarget - Point3d.Origin) * transMatrx transMatrx = Matrix3d.Rotation(-myVP.TwistAngle, myVP.ViewDirection, myVP.ViewTarget) * transMatrx ptCenter = ptCenter.TransformBy(transMatrx)
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register