Adding a dimension to a block.

Adding a dimension to a block.

Anonymous
Not applicable
216 Views
2 Replies
Message 1 of 3

Adding a dimension to a block.

Anonymous
Not applicable
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
0 Likes
217 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
On Tue, 29 May 2001 13:55:32 -0700, "Rob Webb"
wrote:

»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?

Create the dimension in model space, CopyObjects it into the block,
and delete it from model space.

--
Paul Marshall
pmarshal@vulcraft-al.com
0 Likes
Message 3 of 3

Anonymous
Not applicable
Thx Paul. That works great.

"Paul Marshall" wrote in message
news:l4m9ht0sao5vmlihs9148gnh83e2m4822h@4ax.com...
> On Tue, 29 May 2001 13:55:32 -0700, "Rob Webb"
> wrote:
>
> »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?
>
> Create the dimension in model space, CopyObjects it into the block,
> and delete it from model space.
>
> --
> Paul Marshall
> pmarshal@vulcraft-al.com
0 Likes