I thought they did work in C# but unfortunately not in vb. Here are the examples in vb:
<CommandMethod("InsDXF7")> _
Public Sub InsDXF7()
Dim doc As Document = AcadApp.DocumentManager.MdiActiveDocument
Dim ed As Editor = doc.Editor
Dim db As Database = doc.Database
Dim tmpDb As New Database(False, True)
tmpDb.DxfIn("K:\ToTest\Squircle.dxf", "K:\ToTest\Squircle.log")
Dim pnt1 As New Point3d(0, 0, 0)
Dim pnt2 As New Point3d(1000, 1000, 0)
Dim scale As Double = 10.0
Dim vector As New Vector3d(0, 0, 0)
Dim transform As Matrix3d = Matrix3d.Scaling(scale, pnt2) * Matrix3d.Displacement(pnt1.GetVectorTo(pnt2))
Dim lastEnt As ObjectId = AcUtils.EntLast()
Dim newColor As Autodesk.AutoCAD.Colors.Color = Autodesk.AutoCAD.Colors.Color.FromColorIndex(Autodesk.AutoCAD.Colors.ColorMethod.ByAci, 1)
db.Insert(transform, tmpDb, True)
Using tr As Transaction = doc.TransactionManager.StartTransaction()
' if the db was empty lastent will be null
Try
If lastEnt = ObjectId.Null Then
lastEnt = AcUtils.EntFirst()
idColl.Add(lastEnt)
End If
Dim nextent As ObjectId = AcUtils.EntNext(lastEnt)
While nextent <> ObjectId.Null
idColl.Add(nextent)
nextent = AcUtils.EntNext(nextent)
End While
For Each id As ObjectId In idColl
Dim acEntity As Entity = DirectCast(tr.GetObject(id, OpenMode.ForWrite), Entity)
acEntity.Color = newColor
Next
Catch exx As Autodesk.AutoCAD.Runtime.Exception
ed.WriteMessage(vbLf & exx.ToString())
End Try
tr.Commit()
End Using
End Sub
<CommandMethod("InsDXF8")> _
Public Sub InsDXF8()
Dim doc As Document = AcadApp.DocumentManager.MdiActiveDocument
Dim ed As Editor = doc.Editor
Dim db As Database = doc.Database
Dim tmpDb As New Database(False, True)
tmpDb.DxfIn("K:\ToTest\Squircle.dxf", "K:\ToTest\Squircle.log")
Dim pnt1 As New Point3d(0, 0, 0)
Dim pnt2 As New Point3d(1000, 1000, 0)
Dim scale As Double = 10.0
Dim vector As New Vector3d(0, 0, 0)
Dim transform As Matrix3d = Matrix3d.Scaling(scale, pnt2) * Matrix3d.Displacement(pnt1.GetVectorTo(pnt2))
Dim idColl As New ObjectIdCollection()
Dim lastEnt As ObjectId = AcUtils.EntLast()
Dim acEntity As Entity
Dim newColor As Autodesk.AutoCAD.Colors.Color = Autodesk.AutoCAD.Colors.Color.FromColorIndex(Autodesk.AutoCAD.Colors.ColorMethod.ByAci, 1)
db.Insert(transform, tmpDb, True)
Using tr As Transaction = doc.TransactionManager.StartTransaction()
' if the db was empty lastent will be null
Try
If lastEnt = ObjectId.Null Then
lastEnt = AcUtils.EntFirst()
acEntity = DirectCast(tr.GetObject(lastEnt, OpenMode.ForWrite), Entity)
acEntity.Color = newColor
End If
Dim nextent As ObjectId = AcUtils.EntNext(lastEnt)
While nextent <> ObjectId.Null
acEntity = DirectCast(tr.GetObject(nextent, OpenMode.ForWrite), Entity)
acEntity.Color = newColor
nextent = AcUtils.EntNext(nextent)
End While
Catch exx As Autodesk.AutoCAD.Runtime.Exception
ed.WriteMessage(vbLf & exx.ToString())
End Try
tr.Commit()
End Using
End Sub
<CommandMethod("InsDXF9")> _
Public Sub InsDXF9()
Dim doc As Document = AcadApp.DocumentManager.MdiActiveDocument
Dim ed As Editor = doc.Editor
Dim db As Database = doc.Database
Dim tmpDb As New Database(False, True)
tmpDb.DxfIn("K:\ToTest\Squircle.dxf", "K:\ToTest\Squircle.log")
Dim pnt1 As New Point3d(0, 0, 0)
Dim pnt2 As New Point3d(1000, 1000, 0)
Dim scale As Double = 10.0
Dim vector As New Vector3d(0, 0, 0)
Dim transform As Matrix3d = Matrix3d.Scaling(scale, pnt2) * Matrix3d.Displacement(pnt1.GetVectorTo(pnt2))
Dim idColl As New ObjectIdCollection()
Dim acEntity As Entity
Dim newColor As Autodesk.AutoCAD.Colors.Color = Autodesk.AutoCAD.Colors.Color.FromColorIndex(Autodesk.AutoCAD.Colors.ColorMethod.ByAci, 1)
Using tr As Transaction = tmpDb.TransactionManager.StartTransaction()
Try
Dim tmpDbBlockTable As BlockTable = DirectCast(tr.GetObject(tmpDb.BlockTableId, OpenMode.ForRead), BlockTable)
Dim tmpDbModelSpace As BlockTableRecord = DirectCast(tr.GetObject(tmpDbBlockTable(BlockTableRecord.ModelSpace), OpenMode.ForWrite), BlockTableRecord)
For Each id As ObjectId In tmpDbModelSpace
acEntity = DirectCast(tr.GetObject(id, OpenMode.ForWrite), Entity)
acEntity.Color = newColor
Next
tr.Commit()
Catch exx As Autodesk.AutoCAD.Runtime.Exception
ed.WriteMessage(vbLf & exx.ToString())
End Try
End Using
db.Insert(transform, tmpDb, True)
End Sub