AutoCAD 2016 API Dimension Reference BUG

AutoCAD 2016 API Dimension Reference BUG

Anonymous
Not applicable
899 Views
3 Replies
Message 1 of 4

AutoCAD 2016 API Dimension Reference BUG

Anonymous
Not applicable

I tried to figure it out but cannot. For some reason AutoCAD 2016 fails to maintain reference when deleting an item from a block. I added two dimension objects into a block and when I delete one autocad loses reference of an item. Can anyone please help. Below is the code. Thanks.

 

 

Sub DimensionBug()
Dim ACADBlock As ACADBlock
Dim ACADReference As AcadBlockReference
Dim Origin(2) As Double

Dim Dimension As AcadDimRotated
Dim Point1(2) As Double
Dim Point2(2) As Double
Dim Point3(2) As Double

Point2(0) = 10
Point3(1) = 10

Set ACADBlock = ThisDrawing.Blocks.Add(Origin, "NameMe1")

Set Dimension = ACADBlock.AddDimRotated(Point1, Point2, Point3, 0)
Set Dimension = ACADBlock.AddDimRotated(Point1, Point2, Point3, 0)

Set ACADReference = ThisDrawing.ModelSpace.InsertBlock(Origin, "NameMe1", 1, 1, 1, 0)

MsgBox ACADReference.Name
ACADBlock.Item(1).Delete
MsgBox ACADReference.Name

End Sub

0 Likes
900 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Pavel you may get better luck in the visual basic forum.
0 Likes
Message 3 of 4

Anonymous
Not applicable

I dont know where the visual basic form is. I still dont have a solution for it. Thanks

0 Likes
Message 4 of 4

Anonymous
Not applicable
0 Likes