PanHasan
8th Mar 2010, 12:28 am
Hi
how can I append a 3d sphere into the drawing. Sample below works for the circle but not for the spheres why and how to solve this ;) thx
Public Sub addSpheres()
Dim lcmd As Editor = Application.DocumentManager.MdiActiveDocument.Edit or
Dim acbaza As Database = lcmd.Document.Database
Using trn As Transaction = acbaza.TransactionManager.StartTransaction
Dim btr As BlockTableRecord = CType(trn.GetObject(acbaza.CurrentSpaceId, OpenMode.ForWrite), BlockTableRecord)
Dim sph As Sphere = New Sphere(1, New Point3d(1.0, 1.0, 1.0), Vector3d.XAxis, Vector3d.YAxis, 0.0, 0.0, 0.0, 0.0)
btr.AppendEntity(sph)
trn.AddNewlyCreatedDBObject(sph, True)
trn.Commit()
End Using
End Sub
how can I append a 3d sphere into the drawing. Sample below works for the circle but not for the spheres why and how to solve this ;) thx
Public Sub addSpheres()
Dim lcmd As Editor = Application.DocumentManager.MdiActiveDocument.Edit or
Dim acbaza As Database = lcmd.Document.Database
Using trn As Transaction = acbaza.TransactionManager.StartTransaction
Dim btr As BlockTableRecord = CType(trn.GetObject(acbaza.CurrentSpaceId, OpenMode.ForWrite), BlockTableRecord)
Dim sph As Sphere = New Sphere(1, New Point3d(1.0, 1.0, 1.0), Vector3d.XAxis, Vector3d.YAxis, 0.0, 0.0, 0.0, 0.0)
btr.AppendEntity(sph)
trn.AddNewlyCreatedDBObject(sph, True)
trn.Commit()
End Using
End Sub