- DrawRect(acBlkTblRec, acTrans, 0, 0, 5, 5)
- Public Sub DrawRect(ByRef acBlkTblRec As BlockTableRecord, ByRef actrans As Transaction,
- ByVal origPtx As Double, ByVal origPty As Double, ByVal Base As Double, ByVal Haut As Double)
- Dim acDoc As Document = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument
- Dim acCurDb As Database = acDoc.Database
- Dim acLyrTbl As LayerTable
- acLyrTbl = actrans.GetObject(acCurDb.LayerTableId,
- OpenMode.ForRead)
- Dim LCadre As String = "Armat"
- Dim bt As BlockTable = DirectCast(actrans.GetObject(acCurDb.BlockTableId, OpenMode.ForRead), BlockTable)
- Dim btr As BlockTableRecord = New BlockTableRecord()
- If Not bt.Has("Ceramic") Then
- bt.UpgradeOpen()
- btr.Name = "Ceramic"
- bt.Add(btr)
- actrans.AddNewlyCreatedDBObject(btr, True)
- End If
- Dim acPoly As Polyline = New Polyline()
- acPoly.AddVertexAt(0, New Point2d(origPtx + 0.15, origPty + Haut - 0.1), 0, 0.005, 0.005)
- acPoly.AddVertexAt(0, New Point2d(origPtx + 0.12, origPty + Haut + 0.05), 0, 0.005, 0.005)
- acPoly.AddVertexAt(0, New Point2d(origPtx + Base + 0.1, origPty + Haut - 0.05), 0, 0.005, 0.005)
- acPoly.AddVertexAt(0, New Point2d(origPtx + Base, origPty), 0, 0.005, 0.005)
- acPoly.AddVertexAt(0, New Point2d(origPtx, origPty), 0, 0.005, 0.005)
- acPoly.AddVertexAt(0, New Point2d(origPtx, origPty + Haut), 0, 0.005, 0.005)
- acPoly.AddVertexAt(0, New Point2d(origPtx + 0.1, origPty + Haut - 0.1), 0, 0.005, 0.005)
- acPoly.Layer = LCadre
- 'acBlkTblRec.AppendEntity(acPoly)
- 'actrans.AddNewlyCreatedDBObject(acPoly, True)
- btr.AppendEntity(acPoly)
- actrans.AddNewlyCreatedDBObject(acPoly, True)' [b][color=red]problem is here![/color][/b]
- End Sub
本帖以下内容被隐藏保护;需要你回复后,才能看到!
游客,如果您要查看本帖隐藏内容请
回复