Colocação de um "Arc" na coordenada (1,3,0) com raio 5 e angulo inicial 57 e angulo final 172 .
Segue o código:
Imports ZwSoft.ZwCAD.ApplicationServices
Imports ZwSoft.ZwCAD.DatabaseServices
Imports ZwSoft.ZwCAD.Runtime
Imports ZwSoft.ZwCAD.Geometry
Public Sub Arc()
Dim ZWDoc As Document = Application.DocumentManager.MdiActiveDocument
Dim ZWCurDb As Database = ZWDoc.Database
<CommandMethod("NewArc")> _
Public Sub NewArc()
Dim ZWDoc As Document = Application.DocumentManager.MdiActiveDocument
Dim ZwCurDb As Database = ZWDoc.Database
Using ZWTrans As Transaction = ZwCurDb.TransactionManager.StartTransaction()
Dim ZWBlktbl As BlockTable = ZWTrans.GetObject(ZwCurDb.BlockTableId, OpenMode.ForRead)
Dim ZWBlktblrec As BlockTableRecord = ZWTrans.GetObject(ZWBlktbl(BlockTableRecord.ModelSpace), OpenMode.ForWrite)
Using ZWArc As Arc = New Arc(New Point3d(1, 3, 0), 5, 1, 3)
ZWArc.SetDatabaseDefaults()
ZWBlktblrec.AppendEntity(ZWArc)
ZWTrans.AddNewlyCreatedDBObject(ZWArc, True)
ZWTrans.Commit()
End Using
End Using
End Sub
End Class
Após escrever o código, deve-se criar o dll. No ZWCad, na linha de comando: netload carregar o dll criado. na linha de comando chamamos então o comando criado neste caso: NewArc.Testem
Cumprimentos.