<?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: Placement of Dimension Line/Text in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/placement-of-dimension-line-text/m-p/2071832#M76964</link>
    <description>I think you need 'TextLineSpacingFactor'.&lt;BR /&gt;
&lt;BR /&gt;
I hope below sample code is useful for you.&lt;BR /&gt;
&lt;BR /&gt;
'#### code ######&lt;BR /&gt;
Dim DimApi As New Autodesk.AutoCAD.DatabaseServices.AlignedDimension&lt;BR /&gt;
&lt;BR /&gt;
DimApi.UsingDefaultTextPosition = True&lt;BR /&gt;
                    DimApi.TextLineSpacingStyle = LineSpacingStyle.AtLeast&lt;BR /&gt;
                    DimApi.TextLineSpacingFactor = 2&lt;BR /&gt;
                    DimApi.TextAttachment = AttachmentPoint.BottomCenter&lt;BR /&gt;
                    DimApi.TextPosition = Request.Dims.TxtInsertPoint

Message was edited by: cjmprog</description>
    <pubDate>Wed, 19 Sep 2007 05:53:17 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2007-09-19T05:53:17Z</dc:date>
    <item>
      <title>Placement of Dimension Line/Text</title>
      <link>https://forums.autodesk.com/t5/net-forum/placement-of-dimension-line-text/m-p/2071831#M76963</link>
      <description>I'm using AutoCAD 2007 and VB.net 2005.  The VB.net code below works fine except that the Dimension line and Text are not off-set from the object I'm dimensioning.  The dimension line is directly inline with the points that I want to dimension.  I would like the Dimension line and Text to be 1/2" offset from the object I am dimensioning.  &lt;BR /&gt;
&lt;BR /&gt;
Does anybody know how to modify this code so the dimension line will be 1/2" away from the object?&lt;BR /&gt;
&lt;BR /&gt;
Thanks for your help,&lt;BR /&gt;
&lt;BR /&gt;
Private Function CreatedDim(ByVal x1, ByVal y1, ByVal x2, ByVal y2) As ObjectId&lt;BR /&gt;
&lt;BR /&gt;
        Dim pt1 As New Geometry.Point3d(x1, y1, 0)&lt;BR /&gt;
        Dim pt2 As New Geometry.Point3d(x2, y2, 0)&lt;BR /&gt;
        Dim db As Database = Application.DocumentManager.MdiActiveDocument.Database&lt;BR /&gt;
        Dim myTransMan As DatabaseServices.TransactionManager = db.TransactionManager&lt;BR /&gt;
        Dim myTrans As Transaction = myTransMan.StartTransaction()&lt;BR /&gt;
        Dim newActLayerName, strLayerColor, intLineWt As String&lt;BR /&gt;
        strLayerColor = "Red"&lt;BR /&gt;
        intLineWt = "015"&lt;BR /&gt;
        newActLayerName = "TEXT"&lt;BR /&gt;
        ChangeLayer(newActLayerName, strLayerColor, intLineWt)&lt;BR /&gt;
&lt;BR /&gt;
        Using myTrans&lt;BR /&gt;
            Dim bt As BlockTable = myTrans.GetObject(db.BlockTableId, OpenMode.ForRead, False)&lt;BR /&gt;
            Dim btr As BlockTableRecord = myTrans.GetObject(bt(BlockTableRecord.ModelSpace), OpenMode.ForWrite, False)&lt;BR /&gt;
            Dim rd As New RotatedDimension&lt;BR /&gt;
            rd.XLine1Point = pt1&lt;BR /&gt;
            rd.XLine2Point = pt2&lt;BR /&gt;
            rd.TextAttachment = AttachmentPoint.TopMid&lt;BR /&gt;
            btr.AppendEntity(rd)&lt;BR /&gt;
            myTrans.AddNewlyCreatedDBObject(rd, True)&lt;BR /&gt;
            myTrans.Commit()&lt;BR /&gt;
        End Using&lt;BR /&gt;
  &lt;BR /&gt;
        myTrans.Dispose()&lt;BR /&gt;
        myTransMan.Dispose()&lt;BR /&gt;
    End Function</description>
      <pubDate>Wed, 19 Sep 2007 02:14:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/placement-of-dimension-line-text/m-p/2071831#M76963</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-09-19T02:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: Placement of Dimension Line/Text</title>
      <link>https://forums.autodesk.com/t5/net-forum/placement-of-dimension-line-text/m-p/2071832#M76964</link>
      <description>I think you need 'TextLineSpacingFactor'.&lt;BR /&gt;
&lt;BR /&gt;
I hope below sample code is useful for you.&lt;BR /&gt;
&lt;BR /&gt;
'#### code ######&lt;BR /&gt;
Dim DimApi As New Autodesk.AutoCAD.DatabaseServices.AlignedDimension&lt;BR /&gt;
&lt;BR /&gt;
DimApi.UsingDefaultTextPosition = True&lt;BR /&gt;
                    DimApi.TextLineSpacingStyle = LineSpacingStyle.AtLeast&lt;BR /&gt;
                    DimApi.TextLineSpacingFactor = 2&lt;BR /&gt;
                    DimApi.TextAttachment = AttachmentPoint.BottomCenter&lt;BR /&gt;
                    DimApi.TextPosition = Request.Dims.TxtInsertPoint

Message was edited by: cjmprog</description>
      <pubDate>Wed, 19 Sep 2007 05:53:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/placement-of-dimension-line-text/m-p/2071832#M76964</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-09-19T05:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: Placement of Dimension Line/Text</title>
      <link>https://forums.autodesk.com/t5/net-forum/placement-of-dimension-line-text/m-p/2071833#M76965</link>
      <description>Below is the amended code.  Your line of code  " DimApi.TextPosition = Request.Dims.TxtInsertPoint " generated errors saying that Request was not declared. What should it be declared as?  Also it says that Dims is not part of AlignedDimension.  &lt;BR /&gt;
&lt;BR /&gt;
The code below runs fine and does not generate errors but the Dimension line is still placed on the 0 x axis no matter where the object is located.&lt;BR /&gt;
&lt;BR /&gt;
Do you have an idea of what is wrong?  Also, should there be an AppendEntity(DimApi) statement?  If so what Block Table Record should it be associated with?&lt;BR /&gt;
&lt;BR /&gt;
Thanks for your help,&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
    Private Function CreateDim(ByVal x1, ByVal y1, ByVal x2, ByVal y2) As ObjectId&lt;BR /&gt;
&lt;BR /&gt;
        Dim pt1 As New Geometry.Point3d(x1, y1, 0)&lt;BR /&gt;
        Dim pt2 As New Geometry.Point3d(x2, y2, 0)&lt;BR /&gt;
        Dim db As Database = Application.DocumentManager.MdiActiveDocument.Database&lt;BR /&gt;
        Dim myTransMan As DatabaseServices.TransactionManager = db.TransactionManager&lt;BR /&gt;
        Dim myTrans As Transaction = myTransMan.StartTransaction()&lt;BR /&gt;
 &lt;BR /&gt;
        Using myTrans&lt;BR /&gt;
            Dim bt As BlockTable = myTrans.GetObject(db.BlockTableId, OpenMode.ForRead, False)&lt;BR /&gt;
            Dim btr As BlockTableRecord = myTrans.GetObject(bt(BlockTableRecord.ModelSpace), OpenMode.ForWrite, False)&lt;BR /&gt;
            Dim rd As New RotatedDimension&lt;BR /&gt;
            Dim DimApi As New Autodesk.AutoCAD.DatabaseServices.AlignedDimension&lt;BR /&gt;
&lt;BR /&gt;
            rd.XLine1Point = pt1&lt;BR /&gt;
            rd.XLine2Point = pt2&lt;BR /&gt;
            DimApi.UsingDefaultTextPosition = True&lt;BR /&gt;
            DimApi.TextLineSpacingStyle = LineSpacingStyle.AtLeast&lt;BR /&gt;
            DimApi.TextLineSpacingFactor = 2&lt;BR /&gt;
            DimApi.TextAttachment = AttachmentPoint.BottomCenter&lt;BR /&gt;
 &lt;BR /&gt;
            btr.AppendEntity(rd)&lt;BR /&gt;
            myTrans.AddNewlyCreatedDBObject(rd, True)&lt;BR /&gt;
&lt;BR /&gt;
            myTrans.Commit()&lt;BR /&gt;
        End Using&lt;BR /&gt;
  &lt;BR /&gt;
        myTrans.Dispose()&lt;BR /&gt;
        myTransMan.Dispose()&lt;BR /&gt;
    End Function</description>
      <pubDate>Thu, 20 Sep 2007 02:44:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/placement-of-dimension-line-text/m-p/2071833#M76965</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-09-20T02:44:18Z</dc:date>
    </item>
  </channel>
</rss>

