Message 1 of 2
Plotting: Scale Bar does not update
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hallo everyone,
I'm stuck with my plotting routine - it's working fine beside the fact, that the scale bar does not update according to the size of shown features. I have code as following:
Private Sub UpdateBoundViewPort(pDocument As Document, pViewport As Viewport, currentPlot As PlottingGeometry) pViewport.UpgradeOpen() pViewport.TwistAngle = -((currentPlot.Orientation / 180) * Math.PI) Dim minPoint2d = currentPlot.Point - New Vector2d(currentPlot.Size.Width / 2, currentPlot.Size.Height / 2) Dim maxPoint2d = currentPlot.Point + New Vector2d(currentPlot.Size.Width / 2, currentPlot.Size.Height / 2) Dim vExtents = New Extents3d(New Point3d(minPoint2d.X, minPoint2d.Y, 0), New Point3d(maxPoint2d.X, maxPoint2d.Y, 0)) vExtents.TransformBy(GetRotationMatrix(pViewport)) Dim viewportRatio = pViewport.Width / pViewport.Height Dim vWidth = If(currentPlot.Size.Width <= 0, 1, currentPlot.Size.Width) Dim viewHeight = If(currentPlot.Size.Height <= 0, 1, currentPlot.Size.Height) If vWidth > viewHeight * viewportRatio Then viewHeight = vWidth / viewportRatio End If pViewport.ViewCenter = New Point2d((vExtents.MaxPoint.X + vExtents.MinPoint.X) * 0.5, (vExtents.MaxPoint.Y + vExtents.MinPoint.Y) * 0.5) pViewport.ViewHeight = viewHeight pViewport.UpdateDisplay() End Sub
So i change ViewCenter and ViewHeight on the Viewport. Even thought the ViewHeight is different using different geometries, the Scale Bar does not change, it keeps static. And i checked that the scale bas is linked to the view port.
So, what's wrong here? Does anyone know?
Thank you! 🙂
Greetings,
Alex