<?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 Re: DIMSCALE problem in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/dimscale-problem/m-p/3927011#M49629</link>
    <description>&lt;P&gt;I forgot to mention that I am using AutoCAD mechanical 2012.&lt;/P&gt;</description>
    <pubDate>Fri, 17 May 2013 20:54:36 GMT</pubDate>
    <dc:creator>HJohn1</dc:creator>
    <dc:date>2013-05-17T20:54:36Z</dc:date>
    <item>
      <title>DIMSCALE problem</title>
      <link>https://forums.autodesk.com/t5/net-forum/dimscale-problem/m-p/3920199#M49624</link>
      <description>&lt;P&gt;Hi, I am having problems with dimension after changing the dimscale.&amp;nbsp; The user wants to change the dimscale.&amp;nbsp; The program prompts for the selection of a dimension entity and also for the new dimscale.&amp;nbsp; The dimscale property of the dimension entity is set to the new dimscale.&amp;nbsp; The problem is that the entity is not updated on the screen, even after calling the entity draw method.&amp;nbsp; In VBA there was an Update method, but I can find anything like that in the .NET dimension entity.&amp;nbsp; Can someone help me with this situation? I will really appreciate your help.&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2013 14:54:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dimscale-problem/m-p/3920199#M49624</guid>
      <dc:creator>HJohn1</dc:creator>
      <dc:date>2013-05-13T14:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: DIMSCALE problem</title>
      <link>https://forums.autodesk.com/t5/net-forum/dimscale-problem/m-p/3924843#M49625</link>
      <description>&lt;P&gt;Hi John,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please try using the "DimRegen" command ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&amp;lt;code&amp;gt;
    Application.DocumentManager.MdiActiveDocument.SendStringToExecute("DIMREGEN ", true, false, false);
    Application.DocumentManager.MdiActiveDocument.SendStringToExecute("REGEN ", true, false, false);
&amp;lt;/code&amp;gt;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;The other way to ensure that the update happens is described here:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://adndevblog.typepad.com/autocad/2013/01/force-autocad-to-update-the-graphics-display-area.html" target="_blank"&gt;http://adndevblog.typepad.com/autocad/2013/01/force-autocad-to-update-the-graphics-display-area.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2013 11:43:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dimscale-problem/m-p/3924843#M49625</guid>
      <dc:creator>Balaji_Ram</dc:creator>
      <dc:date>2013-05-16T11:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: DIMSCALE problem</title>
      <link>https://forums.autodesk.com/t5/net-forum/dimscale-problem/m-p/3925336#M49626</link>
      <description>&lt;P&gt;Balaji thank you for your suggestions.&amp;nbsp; I tried them all and the dimension still is not updated on the screen. What I want to do is something like selecting a dimension from the drawing, opening the properties window and changing the dimension overall dimscale.&amp;nbsp; The dimension entity is updated immediately after.&amp;nbsp; Here is my code, if you could say what I am doing wrong I will really appreciate.&amp;nbsp; Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Try

	Using Trans As Transaction = HostApplicationServices.WorkingDatabase.TransactionManager.StartTransaction

		peo = New PromptEntityOptions(vbCrLf &amp;amp; "Please select a dimension: ")

		peo.SetRejectMessage("Please select dimensions only.")

		peo.AddAllowedClass(GetType(Dimension), False)

		peo.AddAllowedClass(GetType(AlignedDimension), False)

		peo.AddAllowedClass(GetType(RotatedDimension), False)

		peo.AddAllowedClass(GetType(ArcDimension), False)

		peo.AddAllowedClass(GetType(RadialDimension), False)

		peo.AddAllowedClass(GetType(OrdinateDimension), False)

		per = Ed.GetEntity(peo)

		If per.Status = PromptStatus.OK Then

			Id = per.ObjectId

		Else

			Return False

		End If

		BlkTbl = CType(Trans.GetObject(Db.BlockTableId, OpenMode.ForRead), BlockTable)

		BlkTblr = CType(Trans.GetObject(BlkTbl(BlockTableRecord.ModelSpace), OpenMode.ForWrite), BlockTableRecord)

		Ent = CType(Trans.GetObject(Id, OpenMode.ForWrite), Entity)

		If TypeOf (Ent) Is AlignedDimension Then

			AlignDim = CType(Ent, AlignedDimension)

			AlignDim.Dimscale = NewDimScale

		ElseIf TypeOf (Ent) Is RotatedDimension Then

			RotatedDim = CType(Ent, RotatedDimension)

			RotatedDim.Dimscale = NewDimScale


		ElseIf TypeOf (Ent) Is ArcDimension Then

			ArcDim = CType(Ent, ArcDimension)

			ArcDim.Dimscale = NewDimScale

		ElseIf TypeOf (Ent) Is RadialDimension Then

			RadialDim = CType(Ent, RadialDimension)

			RadialDim.Dimscale = NewDimScale

		ElseIf TypeOf (Ent) Is OrdinateDimension Then

			OrdinateDim = CType(Ent, OrdinateDimension)

			OrdinateDim.Dimscale = NewDimScale

		End If

		Ent.Draw()

		Trans.Commit()

		Trans.TransactionManager.QueueForGraphicsFlush()

		Application.DocumentManager.MdiActiveDocument.SendStringToExecute("DIMREGEN", True, False, False)

        Application.DocumentManager.MdiActiveDocument.SendStringToExecute("REGEN", True, False, False)
						
		Autodesk.AutoCAD.Internal.LayerUtilities.RegenLayers({Ent.LayerId}, Autodesk.AutoCAD.Internal.LayerUtilities.RegenPending)

	End Using

	Return True

Catch ex As Exception

	 MessageBox.Show(ex.Message, "DimScale Error", MessageBoxButtons.OK, MessageBoxIcon.Error)

Finally

	DocLock.Dispose()

End Try&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2013 17:10:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dimscale-problem/m-p/3925336#M49626</guid>
      <dc:creator>HJohn1</dc:creator>
      <dc:date>2013-05-16T17:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: DIMSCALE problem</title>
      <link>https://forums.autodesk.com/t5/net-forum/dimscale-problem/m-p/3925535#M49627</link>
      <description>&lt;P&gt;You don't need most of that code if you only want to update the dimension scale.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Dimscale property is a property of the Dimension base type, so you don't need all of that if/then/else business that tests the type and casts it to the concrete dimension type.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just open the selected object and cast it to a Dimension (you don't have to check it first because you're using AddAllowedClass).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After you cast the selected object to a Dimension, and set its Dimscale, call the &lt;EM&gt;&lt;STRONG&gt;GenerateLayout()&lt;/STRONG&gt;&lt;/EM&gt; method.&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2013 19:44:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dimscale-problem/m-p/3925535#M49627</guid>
      <dc:creator>DiningPhilosopher</dc:creator>
      <dc:date>2013-05-16T19:44:57Z</dc:date>
    </item>
    <item>
      <title>Re: DIMSCALE problem</title>
      <link>https://forums.autodesk.com/t5/net-forum/dimscale-problem/m-p/3926477#M49628</link>
      <description>&lt;P&gt;DPhilosopher thank you for your suggestion, the unnecessary code as well.&amp;nbsp; However, this still is not solving the issue. The screen is updated, but the dimensions are in limbo state.&amp;nbsp; They are visible on the screen but they can not be selected, even after calling the regen command. Any suggestion on how to solve this issue.&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2013 12:58:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dimscale-problem/m-p/3926477#M49628</guid>
      <dc:creator>HJohn1</dc:creator>
      <dc:date>2013-05-17T12:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: DIMSCALE problem</title>
      <link>https://forums.autodesk.com/t5/net-forum/dimscale-problem/m-p/3927011#M49629</link>
      <description>&lt;P&gt;I forgot to mention that I am using AutoCAD mechanical 2012.&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2013 20:54:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dimscale-problem/m-p/3927011#M49629</guid>
      <dc:creator>HJohn1</dc:creator>
      <dc:date>2013-05-17T20:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: DIMSCALE problem</title>
      <link>https://forums.autodesk.com/t5/net-forum/dimscale-problem/m-p/3927155#M49631</link>
      <description>&lt;P&gt;The code you posted contains a collection of hacks that aren't working, but you didn't bother removing them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first hack you need to remove is this:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Ent.Draw()&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11px; line-height: 14px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11px; line-height: 14px;"&gt;Second, don't use the TransactionManager from HostApplicationServices.WorkingDatabase.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use the active document's Transaction manager, and remove the call to QueueForGraphicsFlush(), since the Transaction takes care of that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lastly, get rid of the call to SendStringToExecute() to run the DIMREGEN command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you're going to hack by trying various things, and they don't solve the problem, don't leave them in the code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 18 May 2013 02:55:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dimscale-problem/m-p/3927155#M49631</guid>
      <dc:creator>DiningPhilosopher</dc:creator>
      <dc:date>2013-05-18T02:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: DIMSCALE problem</title>
      <link>https://forums.autodesk.com/t5/net-forum/dimscale-problem/m-p/3928161#M49632</link>
      <description>&lt;P&gt;Hi John,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a sample code that I tried with AutoCAD 2012 and the dimension scale took effect correctly.&lt;/P&gt;
&lt;P&gt;This is a cleaned up version of your code and most of it are suggestions that DP had already provided.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;        &amp;lt;CommandMethod("BR")&amp;gt; _
        Public Sub DimensionUpdateMethod()

            Dim activeDoc As Document
            activeDoc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument

            Dim ed As Editor
            ed = activeDoc.Editor
            Dim peo As PromptEntityOptions
            peo = New PromptEntityOptions(vbCrLf &amp;amp; "Please select a dimension: ")
            peo.SetRejectMessage("Please select dimensions only.")
            peo.AddAllowedClass(GetType(Dimension), False)

            Dim Id As ObjectId
            Dim per As PromptEntityResult
            per = ed.GetEntity(peo)
            If per.Status &amp;lt;&amp;gt; PromptStatus.OK Then
                Return
            End If

            Dim NewDimScale As Double
            NewDimScale = 3.0

            Id = per.ObjectId

            Using Trans As Transaction = activeDoc.TransactionManager.StartTransaction

                Dim BlkTbl As BlockTable
                BlkTbl = CType(Trans.GetObject(activeDoc.Database.BlockTableId, OpenMode.ForRead), BlockTable)

                Dim BlkTabr As BlockTableRecord
                BlkTabr = CType(Trans.GetObject(BlkTbl(BlockTableRecord.ModelSpace), OpenMode.ForWrite), BlockTableRecord)

                Dim Ent As Entity
                Ent = CType(Trans.GetObject(Id, OpenMode.ForWrite), Entity)

                Dim dimension As Dimension
                dimension = CType(Ent, Dimension)
                dimension.Dimscale = NewDimScale

                Trans.Commit()
            End Using
        End Sub&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, It appears that the issue you are having is specific to AutoCAD Mechanical and there are a few features that do behave differently in the verticals.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://docs.autodesk.com/AMECH_PP/2014/ENU/index.html?url=files/GUID-7B1C5317-E960-49C8-A2F0-D32E2D6F4BA1.htm,topicNumber=d30e22165" target="_blank"&gt;http://docs.autodesk.com/AMECH_PP/2014/ENU/index.html?url=files/GUID-7B1C5317-E960-49C8-A2F0-D32E2D6F4BA1.htm,topicNumber=d30e22165&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the above post, please refer to "&lt;SPAN class="collapsible-section-title"&gt;Special Notes on DIMLFAC &amp;amp; DIMSCALE"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="collapsible-section-title"&gt;Sorry, I dont have a solution to get it working in AutoCAD Mechanical and a&lt;/SPAN&gt;&lt;SPAN class="collapsible-section-title"&gt;n expert in the AutoCAD Mechanical discussion forum might be able to help.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2013 05:58:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dimscale-problem/m-p/3928161#M49632</guid>
      <dc:creator>Balaji_Ram</dc:creator>
      <dc:date>2013-05-20T05:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: DIMSCALE problem</title>
      <link>https://forums.autodesk.com/t5/net-forum/dimscale-problem/m-p/3928181#M49633</link>
      <description>Hi Balaji.&lt;BR /&gt;&lt;BR /&gt;In the interest of promoting best practices, you wouldn't cast the DBObject returned by GetObject() to an Entity first, and then to a Dimension. You would just cast it to a Dimension, since you can assume that it is one.</description>
      <pubDate>Mon, 20 May 2013 07:12:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dimscale-problem/m-p/3928181#M49633</guid>
      <dc:creator>DiningPhilosopher</dc:creator>
      <dc:date>2013-05-20T07:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: DIMSCALE problem</title>
      <link>https://forums.autodesk.com/t5/net-forum/dimscale-problem/m-p/3928190#M49634</link>
      <description>&lt;P&gt;Hi DP,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You are right, casting it twice is not needed.&lt;/P&gt;
&lt;P&gt;Thanks for correcting that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2013 07:32:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dimscale-problem/m-p/3928190#M49634</guid>
      <dc:creator>Balaji_Ram</dc:creator>
      <dc:date>2013-05-20T07:32:43Z</dc:date>
    </item>
    <item>
      <title>Re: DIMSCALE problem</title>
      <link>https://forums.autodesk.com/t5/net-forum/dimscale-problem/m-p/3930404#M49635</link>
      <description>&lt;P&gt;Balaji, thank you very much for your help.&amp;nbsp; I tried the code in AutoCAD 2012 and it works as it should.&amp;nbsp; In mechanical I am still having the problem.&amp;nbsp; Also, thanks to DP for your comments they were all well taken.&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2013 15:04:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dimscale-problem/m-p/3930404#M49635</guid>
      <dc:creator>HJohn1</dc:creator>
      <dc:date>2013-05-21T15:04:04Z</dc:date>
    </item>
  </channel>
</rss>

