Sorry, again I'm NOT using the block editor. I define a BlockTableRecord and add it to the BlockTable of the database. Something like this...
Code:
Dim Blocks As BlockTable
Dim ObjId As ObjectId
Dim Block As BlockTableRecord
Dim Trans As Transaction
Dim BasePoint As Point2d
Trans = Database.TransactionManager.StartTransaction
Try
Blocks = Trans.GetObject(Database.BlockTableId, Autodesk.AutoCAD.DatabaseServices.OpenMode.ForWrite, False, False)
ObjId = Blocks.Add(New BlockTableRecord)
Block = Trans.GetObject(ObjId, Autodesk.AutoCAD.DatabaseServices.OpenMode.ForWrite, False, False)
Block.Name = "MyBlockNameHere"
Block.Units = Autodesk.AutoCAD.DatabaseServices.UnitsValue.Undefined
Block.BlockScaling = Autodesk.AutoCAD.DatabaseServices.BlockScaling.Uniform
Block.Comments = "This block is generated automatically and should not be edited."
Block.Explodable = False
Trans.AddNewlyCreatedDBObject(Block, True)
' Code to add geometry goes here...
' Need some other code here to add dynamic properties???
Catch ex As Autodesk.AutoCAD.Runtime.Exception
Application.ShowAlertDialog("CreateBlock" & vbNewLine & ex.ToString)
Block = Nothing
Trans.Abort()
Finally
Trans.Dispose()
Trans = Nothing
Database = Nothing
End Try