d:\1.jpg
d:\2.jpg
-
- Private Sub btnCloseLayer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCloseLayer.Click
- Dim db As Database = HostApplicationServices.WorkingDatabase
- Dim LineEnt As New Line(New Point3d(100, 200, 0), New Point3d(300, 500, 0))
- Using trans As Transaction = db.TransactionManager.StartTransaction
- Dim bt As BlockTable = trans.GetObject(db.BlockTableId, OpenMode.ForRead)
- Dim btr As BlockTableRecord = trans.GetObject(bt.Item(BlockTableRecord.ModelSpace), OpenMode.ForWrite)
- btr.AppendEntity(LineEnt)
- trans.AddNewlyCreatedDBObject(LineEnt, True)
- trans.Commit()
- End Using
- End Sub
|