<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Plotting: Scale Bar does not update in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/plotting-scale-bar-does-not-update/m-p/7148549#M30996</link>
    <description>&lt;P&gt;Hallo everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;    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 &amp;lt;= 0, 1, currentPlot.Size.Width)
      Dim viewHeight = If(currentPlot.Size.Height &amp;lt;= 0, 1, currentPlot.Size.Height)
      If vWidth &amp;gt; 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&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;So, what's wrong here? Does anyone know?&lt;/P&gt;&lt;P&gt;Thank you! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;</description>
    <pubDate>Tue, 13 Jun 2017 12:49:02 GMT</pubDate>
    <dc:creator>trindelhaven</dc:creator>
    <dc:date>2017-06-13T12:49:02Z</dc:date>
    <item>
      <title>Plotting: Scale Bar does not update</title>
      <link>https://forums.autodesk.com/t5/net-forum/plotting-scale-bar-does-not-update/m-p/7148549#M30996</link>
      <description>&lt;P&gt;Hallo everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;    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 &amp;lt;= 0, 1, currentPlot.Size.Width)
      Dim viewHeight = If(currentPlot.Size.Height &amp;lt;= 0, 1, currentPlot.Size.Height)
      If vWidth &amp;gt; 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&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;So, what's wrong here? Does anyone know?&lt;/P&gt;&lt;P&gt;Thank you! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2017 12:49:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/plotting-scale-bar-does-not-update/m-p/7148549#M30996</guid>
      <dc:creator>trindelhaven</dc:creator>
      <dc:date>2017-06-13T12:49:02Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting: Scale Bar does not update</title>
      <link>https://forums.autodesk.com/t5/net-forum/plotting-scale-bar-does-not-update/m-p/7151430#M30997</link>
      <description>&lt;P&gt;Can anyone tell me, how i might be able to access the scale bar, so i can manually adjust the displayed numbers?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2017 10:57:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/plotting-scale-bar-does-not-update/m-p/7151430#M30997</guid>
      <dc:creator>trindelhaven</dc:creator>
      <dc:date>2017-06-14T10:57:10Z</dc:date>
    </item>
  </channel>
</rss>

