<?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 : Dimension In 3d Using VB.Net in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/dimension-in-3d-using-vb-net/m-p/5287371#M42678</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You also need to set the Rotation, Normal and Elevation properties.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;            Document doc = AcAp.DocumentManager.MdiActiveDocument;
            Database db = doc.Database;

            using (Transaction tr = db.TransactionManager.StartTransaction())
            {
                var space = (BlockTableRecord)tr.GetObject(
                    SymbolUtilityServices.GetBlockModelSpaceId(db), OpenMode.ForWrite);
                var dim = new RotatedDimension();
                dim.SetDatabaseDefaults();
                dim.XLine1Point = new Point3d(120.0, 120.0, 0.0);
                dim.XLine2Point = new Point3d(120.0, 120.0, 120.0);
                dim.DimLinePoint = new Point3d(140.0, 120.0, 0.0); &lt;BR /&gt;                dim.Rotation = Math.PI / 2.0; // 90° for vertical rotated dimension
                dim.Normal = new Vector3d(0.0, -1.0, 0.0); // parallel to XZ plane
                dim.Elevation = -120.0; // Elevation on the XZ plane
                space.AppendEntity(dim);
                tr.AddNewlyCreatedDBObject(dim, true);
                tr.Commit();
            }&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 20 Sep 2014 17:25:24 GMT</pubDate>
    <dc:creator>_gile</dc:creator>
    <dc:date>2014-09-20T17:25:24Z</dc:date>
    <item>
      <title>Dimension In 3d Using VB.Net</title>
      <link>https://forums.autodesk.com/t5/net-forum/dimension-in-3d-using-vb-net/m-p/5278641#M42677</link>
      <description>&lt;P&gt;I'm writing a .Net extension for AutoCAD and I've been unsucessful in trying to make dimensions in 3d (i.e. on the z axis). &amp;nbsp;Here is the code that I'm have&amp;nbsp;to try to accomplish this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Dim doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument
Dim db = doc.Database
Dim ed = doc.Editor

Using trx As Transaction = db.TransactionManager.StartTransaction()

	' Open the Block table for read
	Dim bt As BlockTable = TryCast(db.BlockTableId.GetObject(OpenMode.ForRead), BlockTable)
	' Open the Block table record Model space for write
	Dim acBlkTblRec As BlockTableRecord = trx.GetObject(bt(BlockTableRecord.ModelSpace), OpenMode.ForWrite)

	' Create the dimension
	Dim acRotDim As RotatedDimension = New RotatedDimension()
	acRotDim.SetDatabaseDefaults()
	acRotDim.XLine1Point = New Point3d(120, 120, 0)
	acRotDim.XLine2Point = New Point3d(120, 120, 120)
	acRotDim.DimLinePoint = New Point3d(140, 120, 0)

	' Add the new object to Model space and the transaction
	acBlkTblRec.AppendEntity(acRotDim)
	trx.AddNewlyCreatedDBObject(acRotDim, True)

	trx.Commit()
End Using&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When this code is run the dimension is created and the extension line snaps are in the correct places. &amp;nbsp;However, the lines and text are stuck on the "ground" and it's shows a distance of 0. &amp;nbsp;How can I create the dimension so that it's on the right plane?&lt;/P&gt;</description>
      <pubDate>Tue, 16 Sep 2014 20:55:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dimension-in-3d-using-vb-net/m-p/5278641#M42677</guid>
      <dc:creator>NEP_perpetual</dc:creator>
      <dc:date>2014-09-16T20:55:42Z</dc:date>
    </item>
    <item>
      <title>Re : Dimension In 3d Using VB.Net</title>
      <link>https://forums.autodesk.com/t5/net-forum/dimension-in-3d-using-vb-net/m-p/5287371#M42678</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You also need to set the Rotation, Normal and Elevation properties.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;            Document doc = AcAp.DocumentManager.MdiActiveDocument;
            Database db = doc.Database;

            using (Transaction tr = db.TransactionManager.StartTransaction())
            {
                var space = (BlockTableRecord)tr.GetObject(
                    SymbolUtilityServices.GetBlockModelSpaceId(db), OpenMode.ForWrite);
                var dim = new RotatedDimension();
                dim.SetDatabaseDefaults();
                dim.XLine1Point = new Point3d(120.0, 120.0, 0.0);
                dim.XLine2Point = new Point3d(120.0, 120.0, 120.0);
                dim.DimLinePoint = new Point3d(140.0, 120.0, 0.0); &lt;BR /&gt;                dim.Rotation = Math.PI / 2.0; // 90° for vertical rotated dimension
                dim.Normal = new Vector3d(0.0, -1.0, 0.0); // parallel to XZ plane
                dim.Elevation = -120.0; // Elevation on the XZ plane
                space.AppendEntity(dim);
                tr.AddNewlyCreatedDBObject(dim, true);
                tr.Commit();
            }&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Sep 2014 17:25:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dimension-in-3d-using-vb-net/m-p/5287371#M42678</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2014-09-20T17:25:24Z</dc:date>
    </item>
    <item>
      <title>Re : Dimension In 3d Using VB.Net</title>
      <link>https://forums.autodesk.com/t5/net-forum/dimension-in-3d-using-vb-net/m-p/5293593#M42679</link>
      <description>&lt;P&gt;Thanks, that works perfectly!&lt;/P&gt;</description>
      <pubDate>Tue, 23 Sep 2014 19:36:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dimension-in-3d-using-vb-net/m-p/5293593#M42679</guid>
      <dc:creator>NEP_perpetual</dc:creator>
      <dc:date>2014-09-23T19:36:24Z</dc:date>
    </item>
  </channel>
</rss>

