Imports Autodesk.AutoCAD.ApplicationServices Imports Autodesk.AutoCAD.EditorInput Imports Autodesk.AutoCAD.Runtime Imports Autodesk.AutoCAD.DatabaseServices Imports Autodesk.AutoCAD.Geometry Imports Autodesk.AutoCAD.Colors Public Class Class1 _ Public Sub Draw() Dim db As Database = HostApplicationServices.WorkingDatabase() Dim trans As Transaction = db.TransactionManager.StartTransaction() Try Dim bt As BlockTable = trans.GetObject(db.BlockTableId, OpenMode.ForWrite) Dim btr As BlockTableRecord = trans.GetObject(bt(btr.ModelSpace), OpenMode.ForWrite) 'Create the block reference...use the return from CreateEmployeeDefinition directly! Dim corner1 As New Point3d(0, 0, 0) Dim corner2 As New Point3d(10, 0, 0) Dim corner3 As New Point3d(10, 10, 0) Dim dPtList(6) As Double dPtList(0) = corner1.X dPtList(1) = corner1.Y dPtList(2) = corner2.X dPtList(3) = corner2.Y dPtList(4) = corner3.X dPtList(5) = corner3.Y Dim ln As Line2d(dPtList) 'btr.AppendEntity(ln) 'Add the reference to ModelSpace 'trans.AddNewlyCreatedDBObject(ln, True) 'Let the transaction know about it 'trans.Commit() Finally trans.Dispose() End Try End Sub End Class