Message 1 of 3
Adding a dimension to a block.

Not applicable
05-29-2001
05:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am having problems adding a dimension to a block. When the block is
inserted, the display shows a zero dimension and the line is in the
incorrect position. When the block is exploded, it shows properly. Any
ideas on how to get the block to show the dimension correctly?
Option Explicit
Sub DimBlkTest()
Dim pt0(0 To 2) As Double
Dim ptDim1(0 To 2) As Double
Dim ptDim2(0 To 2) As Double
Dim ptINS(0 To 2) As Double
Dim tmpDim As AcadDimension
Dim blkNewBlock As AcadBlock
Dim dblLength As Double
dblLength = 50
Set blkNewBlock = ThisDrawing.Blocks.Add(pt0, "TEST1")
ptDim1(0) = 0#: ptDim1(1) = 0#: ptDim1(2) = 0#
ptDim2(0) = 500#: ptDim2(1) = 0#: ptDim2(2) = 0#
ptINS(0) = dblLength / 2: ptINS(1) = 150: ptINS(2) = 0#
Set tmpDim = blkNewBlock.AddDimAligned(ptDim1, ptDim2, ptINS)
ThisDrawing.ModelSpace.InsertBlock pt0, "TEST1", 1, 1, 1, 0
End Sub
inserted, the display shows a zero dimension and the line is in the
incorrect position. When the block is exploded, it shows properly. Any
ideas on how to get the block to show the dimension correctly?
Option Explicit
Sub DimBlkTest()
Dim pt0(0 To 2) As Double
Dim ptDim1(0 To 2) As Double
Dim ptDim2(0 To 2) As Double
Dim ptINS(0 To 2) As Double
Dim tmpDim As AcadDimension
Dim blkNewBlock As AcadBlock
Dim dblLength As Double
dblLength = 50
Set blkNewBlock = ThisDrawing.Blocks.Add(pt0, "TEST1")
ptDim1(0) = 0#: ptDim1(1) = 0#: ptDim1(2) = 0#
ptDim2(0) = 500#: ptDim2(1) = 0#: ptDim2(2) = 0#
ptINS(0) = dblLength / 2: ptINS(1) = 150: ptINS(2) = 0#
Set tmpDim = blkNewBlock.AddDimAligned(ptDim1, ptDim2, ptINS)
ThisDrawing.ModelSpace.InsertBlock pt0, "TEST1", 1, 1, 1, 0
End Sub