을 트랜잭션 클래스를 사용하지 않고 VB에서 선 그리기 내 작업 중 하나가 나를 도울 수있는 거래 를 사용하지 않고 라인을 만드는 것입니다AutoCAD를
Public Sub CreateLine()
Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument
Dim acCurDb As Database = acDoc.Database
Using acTrans As Transaction = acCurDb.TransactionManager.StartTransaction()
Dim acBlkTbl As BlockTable
acBlkTbl = acTrans.GetObject(acCurDb.BlockTableId, OpenMode.ForRead)
Dim acBlkTblRec As BlockTableRecord
acBlkTblRec = acTrans.GetObject(acBlkTbl(BlockTableRecord.ModelSpace), _
OpenMode.ForWrite)
procedure(acTrans, acBlkTblRec, 11, 3, 0, 5, 5, 0)
acTrans.Commit()
End Using
End Sub
Private Sub procedure(ByVal var1 As Transaction, ByVal var2 As BlockTableRecord, ByVal x As Double, ByVal y As Double, ByVal z As Double, ByVal x1 As Double, ByVal y1 As Double, ByVal z1 As Double)
Dim ac As Line = New Line(New Point3d(x, y, z), _
New Point3d(x1, y1, z1))
var2.AppendEntity(ac)
var1.AddNewlyCreatedDBObject(ac, True)
End Sub
...
이것은 분명히 누군가의 숙제입니다. 트랜잭션 외부에서 AutoCAD 데이터베이스를 수정하지 마십시오. –