Try this function from my working code
Just adapt it to your needs
Public Shared Function CreateLabelBlock() As ObjectId
Try
Dim ID As ObjectId
Dim db As Database = HostApplicationServices.WorkingDatabase()
Using tr As Transaction = db.TransactionManager.StartTransaction()
Dim bt As BlockTable = CType(tr.GetObject(db.BlockTableId, OpenMode.ForWrite, False), BlockTable)
If (bt.Has("LABEL")) Then
ID = bt("LABEL")
Else
Dim btr As BlockTableRecord = New BlockTableRecord()
btr.Name = "LABEL"
btr.Origin = New Point3d(0, 0, 0)
btr.Units = UnitsValue.Inches
btr.BlockScaling = BlockScaling.Uniform
Dim line As Line = New Line(New Point3d(-2, -0.4, 0), New Point3d(2, -0.4, 0))
line.Layer = "0"
line.ColorIndex = 14
btr.AppendEntity(line)
line = New Line(New Point3d(-2, 0.4, 0), New Point3d(2, 0.4, 0))
line.Layer = "0"
line.ColorIndex = 14
btr.AppendEntity(line)
line = New Line(New Point3d(2, -0.4, 0), New Point3d(2, 0.4, 0))
line.Layer = "0"
line.ColorIndex = 14
btr.AppendEntity(line)
line = New Line(New Point3d(-2, -0.4, 0), New Point3d(-2, 0.4, 0))
line.Layer = "0"
line.ColorIndex = 14
btr.AppendEntity(line)
acadApp.SetSystemVariable("CECOLOR", "ByBlock")
Dim ad As AttributeDefinition = New AttributeDefinition
ad.Layer = "0"
ad.Tag = "DETAIL"
ad.TextString = "Ladder"
ad.Prompt = "Detail name"
ad.Position = New Point3d(0, 0, 0)
ad.HorizontalMode = TextHorizontalMode.TextMid
ad.VerticalMode = TextVerticalMode.TextVerticalMid
ad.AlignmentPoint = ad.Position
btr.AppendEntity(ad)
ID = bt.Add(btr)
acadApp.SetSystemVariable("CECOLOR", "ByLayer")
tr.AddNewlyCreatedDBObject(btr, True)
End If
tr.Commit()
End Using
Catch ex As Autodesk.AutoCAD.Runtime.Exception
acadApp.ShowAlertDialog("ERROR:" & vbCr & ex.Message & vbCr & ex.StackTrace)
End Try
End Function
~'J'~