Hi,all.
I can create a spline in one method.
Now, I try in another method.
Suppose I commit an error in using the DoubleCollection option.
How could I get the correct result?
Could anyone help me?
Thanks in advance.
Public Sub CreateSpline()
Dim db As Database = Application.DocumentManager.MdiActiveDocument.Database
Dim t As Transaction = db.TransactionManager.StartTransaction
Try
Dim bt As BlockTable = CType(t.GetObject(db.BlockTableId, OpenMode.ForRead), BlockTable)
Dim btr As BlockTableRecord = CType(t.GetObject(bt(BlockTableRecord.ModelSpace), OpenMode.ForWrite), BlockTableRecord)
Dim v3d As Vector3d = New Vector3d(0, 0, 1)
Dim controlpts As Point3dCollection = New Point3dCollection
controlpts.Add(New Point3d(100, 100, 0))
controlpts.Add(New Point3d(133.3333, 133.3333, 0))
controlpts.Add(New Point3d(166.6666, 166.6666, 0))
controlpts.Add(New Point3d(200, 200, 0))
Dim dc As DoubleCollection = New DoubleCollection
dc.Add(100)
dc.Add(200)
Dim dc1 As DoubleCollection = New DoubleCollection
dc1.Add(300)
dc1.Add(400)
Dim c As Spline = New Spline(3, True, False, True, controlpts, dc, dc1, 0.0, 0.0)
btr.AppendEntity(c)
t.AddNewlyCreatedDBObject(c, True)
t.Commit()
t.Dispose()
Finally
End Try
End Sub