Hi, I want to say that everything seems to be working correctly when I insert a block into my drawing, however it gives me a wrong client object warning when I do it. Other than that everything else seems to be working correctly with the block insertion.
Here is my code (existingPermit is a blockreference that is currently in the drawing and listPermitLocation(1) is the location of the block on the server):
Code:
insertBlockNoLoop(ThisDrawing, _
existingPermit.Layer, _
existingPermit.ColorIndex, _
existingPermit.Position, _
listPermitLocation(1), _
existingPermit.ScaleFactors(0), _
existingPermit.ScaleFactors(1), _
existingPermit.ScaleFactors(2), _
existingPermit.Linetype, _
existingPermit.Rotation)
existingPermit.Erase()
Public Shared Sub insertBlockNoLoop(Drawing As Autodesk.AutoCAD.Interop.AcadDocument, layer As String, color As Integer, userPoint As Point3d, location As String, xscale As Double, yscale As Double, zscale As Double, linetype As String, rotation As Double) Dim tempBlock As AcadBlockReference
Try
Dim inputPoint(0 To 2) As Double
inputPoint(0) = userPoint(0)
inputPoint(1) = userPoint(1)
inputPoint(2) = userPoint(2)
tempBlock = Drawing.ModelSpace.InsertBlock(inputPoint, location, xscale, yscale, zscale, rotation)
tempBlock.Layer = layer
Catch ex As System.Runtime.InteropServices.ExternalException
Catch exs As Exception
End Try
End Sub
I have attached the warning as well and I'm using Map 3D 2014 and VB.net. Also it doesn't seem to give a warning on the first time I replace the block, but after the first time it starts to give this warning and gives it every time.
Thanks for any help,