<?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: How to set Dimensions to Annotative using C#.NET in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/how-to-set-dimensions-to-annotative-using-c-net/m-p/8912565#M21805</link>
    <description>&lt;P&gt;Was this intended for the .NET Forum?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/net/bd-p/152" target="_blank"&gt;https://forums.autodesk.com/t5/net/bd-p/152&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 16 Jul 2019 17:51:30 GMT</pubDate>
    <dc:creator>qnologi</dc:creator>
    <dc:date>2019-07-16T17:51:30Z</dc:date>
    <item>
      <title>How to set Dimensions to Annotative using C#.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-set-dimensions-to-annotative-using-c-net/m-p/8912554#M21804</link>
      <description>&lt;P&gt;We have a template setup with a "_STANDARD" dimension that is Annotative.&lt;/P&gt;&lt;P&gt;When we plot through the C# code below, we access the dimension, and set that.&lt;/P&gt;&lt;P&gt;The properties are being set, &lt;STRONG&gt;except for the Annotation.&lt;/STRONG&gt; Can you please suggest what am I missing?&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Code" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/658084i4D8D626144263E50/image-size/large?v=v2&amp;amp;px=999" role="button" title="AnnotativeScaleCode.jpg" alt="Code" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Code&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Result" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/658083i1EDB05B7A6780AF5/image-size/large?v=v2&amp;amp;px=999" role="button" title="AnnotativeScaleDimensions.jpg" alt="Result" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Result&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2019 17:53:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-set-dimensions-to-annotative-using-c-net/m-p/8912554#M21804</guid>
      <dc:creator>jlobo2</dc:creator>
      <dc:date>2019-07-16T17:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to set Dimensions to Annotative using C#.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-set-dimensions-to-annotative-using-c-net/m-p/8912565#M21805</link>
      <description>&lt;P&gt;Was this intended for the .NET Forum?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/net/bd-p/152" target="_blank"&gt;https://forums.autodesk.com/t5/net/bd-p/152&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2019 17:51:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-set-dimensions-to-annotative-using-c-net/m-p/8912565#M21805</guid>
      <dc:creator>qnologi</dc:creator>
      <dc:date>2019-07-16T17:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to set Dimensions to Annotative using C#.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-set-dimensions-to-annotative-using-c-net/m-p/8912631#M21806</link>
      <description>&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2019 18:42:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-set-dimensions-to-annotative-using-c-net/m-p/8912631#M21806</guid>
      <dc:creator>jlobo2</dc:creator>
      <dc:date>2019-07-16T18:42:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to set Dimensions to Annotative using C#.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-set-dimensions-to-annotative-using-c-net/m-p/8913765#M21807</link>
      <description>&lt;P&gt;Try this sample code:&lt;/P&gt;
&lt;PRE&gt;using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.EditorInput;

[assembly: CommandClass(typeof(DimChangeAnno.MyCommands))]

namespace DimChangeAnno
{

  public class MyCommands
  {
    [CommandMethod("ChgDimAnno")]
    public void ChgDimAnnoHandler()
    {
      Document doc = Application.DocumentManager.MdiActiveDocument;
      if (doc == null) return;
      Editor ed = doc.Editor;
      PromptEntityOptions prOpt = new PromptEntityOptions("\nSelect Dimension: ");
      prOpt.SetRejectMessage("\nIt is not Dimension!");
      prOpt.AddAllowedClass(typeof(Dimension), false);
      PromptEntityResult prRes = ed.GetEntity(prOpt);
      if (prRes.Status == PromptStatus.OK)
      {
        using (Transaction tr = doc.TransactionManager.StartTransaction())
        {
          Dimension dim = tr.GetObject(prRes.ObjectId, OpenMode.ForWrite) as Dimension;
          switch(dim.Annotative)
          {
            case AnnotativeStates.False:
              dim.Annotative = AnnotativeStates.True;
              ed.WriteMessage($"\nAnnotativeStates.False -&amp;gt; {dim.Annotative}");
              break;
            case AnnotativeStates.True:
              dim.Annotative = AnnotativeStates.False;
              ed.WriteMessage($"\nAnnotativeStates.True -&amp;gt; {dim.Annotative}");
              break;
            default:
              ed.WriteMessage("\nAnnotativeStates.NotApplicable");
              break;
          }
          tr.Commit();
        }
      }
    }
  }
}
&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Jul 2019 08:16:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-set-dimensions-to-annotative-using-c-net/m-p/8913765#M21807</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2019-07-17T08:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to set Dimensions to Annotative using C#.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-set-dimensions-to-annotative-using-c-net/m-p/8914803#M21808</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/481027"&gt;@Alexander.Rivilis&lt;/a&gt;&amp;nbsp; I am using a similar code to change the annotative property. But whenever I use it, the dimensions do not show up in the drawing. I am plotting other block attributes as well.&lt;/P&gt;&lt;P&gt;The code, I am using is below:&lt;/P&gt;&lt;PRE&gt;            using (Transaction acTrans = theDb.TransactionManager.StartTransaction())
            {
                pBlockTbl = acTrans.GetObject(theDb.BlockTableId, OpenMode.ForWrite) as BlockTable;
                pModelSpaceTblRcd = acTrans.GetObject(pBlockTbl[BlockTableRecord.ModelSpace], OpenMode.ForWrite) as BlockTableRecord;
                //pBlockTbl.Dispose();           

                // Prepare dimension
                string tempDimensionTextToPlot =  string.Format("{0:0.00}", (rightDist - leftDist));
                
                pDimension = new AlignedDimension(
                    new Point3d(leftDist, originElev, 0),
                    new Point3d(rightDist, originElev, 0),
                    new Point3d(leftDist + ((rightDist - leftDist) / 2), originElev + elevDeltaToDimLine, 0),
                    tempDimensionTextToPlot,
                    idDimensionStyleStandard);        

                //change
                pDimension.DimensionStyle = idDimensionStyleStandard;
                pDimension.LayerId = idLayerDimension;
                &lt;FONT size="4"&gt;&lt;STRONG&gt;pDimension.Annotative =  AnnotativeStates.True;&lt;/STRONG&gt;&lt;/FONT&gt;

                // Add dimension to database
                pModelSpaceTblRcd.AppendEntity(pDimension);
                acTrans.AddNewlyCreatedDBObject(pDimension, true);

                // Finished with this dimension
                //pDimension.Dispose();

                acTrans.Commit();
            }&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Jul 2019 15:11:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-set-dimensions-to-annotative-using-c-net/m-p/8914803#M21808</guid>
      <dc:creator>jlobo2</dc:creator>
      <dc:date>2019-07-17T15:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to set Dimensions to Annotative using C#.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-set-dimensions-to-annotative-using-c-net/m-p/8915161#M21809</link>
      <description>&lt;PRE&gt;[CommandMethod("CreateDimAnno")]
public void CreateDimAnno()
{
  Document doc = Application.DocumentManager.MdiActiveDocument;
  if (doc == null) return;
  Database db = doc.Database;
  Editor ed = doc.Editor;
  using (Transaction tr = doc.TransactionManager.StartTransaction())
  {
    BlockTableRecord curSpace = 
      tr.GetObject(db.CurrentSpaceId, OpenMode.ForWrite) as BlockTableRecord;
    Dimension dim = new AlignedDimension(
                new Point3d(0, 0, 0),
                new Point3d(100, 0, 0),
                new Point3d(50, 20, 0),
                "&amp;lt;&amp;gt;",
                db.Dimstyle);
    dim.SetDatabaseDefaults(db);
&lt;STRONG&gt;    curSpace.AppendEntity(dim);
    dim.Annotative = AnnotativeStates.True;&lt;/STRONG&gt;
    try
    {
      dim.AddContext(db.Cannoscale);
    }
    catch { }
    tr.AddNewlyCreatedDBObject(dim, true);
    tr.Commit();
  }
}
&lt;/PRE&gt;
&lt;P&gt;&lt;IFRAME src="https://screencast.autodesk.com/Embed/Timeline/eb2b9ac4-4445-4b99-9ea9-0e6868fef954" allowfullscreen="allowfullscreen" webkitallowfullscreen="webkitallowfullscreen" width="696" height="715" frameborder="0"&gt;&lt;/IFRAME&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2019 17:15:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-set-dimensions-to-annotative-using-c-net/m-p/8915161#M21809</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2019-07-17T17:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to set Dimensions to Annotative using C#.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-set-dimensions-to-annotative-using-c-net/m-p/8915228#M21810</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/481027"&gt;@Alexander.Rivilis&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That is simply awesome. That worked great.&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I know, that I have to append it first and then change the property?&lt;/P&gt;&lt;P&gt;Is there a website or a course I can learn all these things from?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2019 17:45:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-set-dimensions-to-annotative-using-c-net/m-p/8915228#M21810</guid>
      <dc:creator>jlobo2</dc:creator>
      <dc:date>2019-07-17T17:45:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to set Dimensions to Annotative using C#.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-set-dimensions-to-annotative-using-c-net/m-p/8915237#M21811</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1626012"&gt;@jlobo2&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/481027"&gt;@Alexander.Rivilis&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That is simply awesome. That worked great.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do I know, that I have to append it first and then change the property?&lt;/P&gt;
&lt;P&gt;Is there a website or a course I can learn all these things from?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Annotation Scales reffer to Database. So you have first add it to Database, and after make it annotative.&lt;/P&gt;
&lt;P&gt;Only samples on this forum, other forums and blogs can help you.&lt;/P&gt;
&lt;P&gt;In English:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://adndevblog.typepad.com/autocad/" target="_blank"&gt;http://adndevblog.typepad.com/autocad/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://through-the-interface.typepad.com/through_the_interface/" target="_blank"&gt;http://through-the-interface.typepad.com/through_the_interface/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.theswamp.org/index.php?action=forum" target="_blank"&gt;http://www.theswamp.org/index.php?action=forum&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;In Russian:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://adn-cis.org/forum/" target="_blank"&gt;http://adn-cis.org/forum/&lt;/A&gt;&lt;/P&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>Wed, 17 Jul 2019 17:56:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-set-dimensions-to-annotative-using-c-net/m-p/8915237#M21811</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2019-07-17T17:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to set Dimensions to Annotative using C#.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-set-dimensions-to-annotative-using-c-net/m-p/8925619#M21812</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/481027"&gt;@Alexander.Rivilis&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you share some light for the following post please.&lt;/P&gt;&lt;P&gt;&lt;A title="Rotate a set of objects along an axis" href="https://forums.autodesk.com/t5/autocad-forum/how-to-rotate-set-of-objects-along-an-axis-in-autocad/m-p/8925592" target="_blank" rel="noopener"&gt;Rotate a set of objects along an axis&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I would appreciate your help&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2019 13:44:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-set-dimensions-to-annotative-using-c-net/m-p/8925619#M21812</guid>
      <dc:creator>jlobo2</dc:creator>
      <dc:date>2019-07-23T13:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to set Dimensions to Annotative using C#.NET</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-set-dimensions-to-annotative-using-c-net/m-p/8926223#M21813</link>
      <description>&lt;P&gt;I'm sorry, but code is above my pay grade : (&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2019 18:23:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-set-dimensions-to-annotative-using-c-net/m-p/8926223#M21813</guid>
      <dc:creator>qnologi</dc:creator>
      <dc:date>2019-07-23T18:23:34Z</dc:date>
    </item>
  </channel>
</rss>

