Author Topic: How to Erase Empty Object in AutoCAD2008  (Read 1517 times)

0 Members and 1 Guest are viewing this topic.

guohq

  • Newt
  • Posts: 84
How to Erase Empty Object in AutoCAD2008
« on: August 19, 2015, 08:58:08 PM »
I can use Database.EraseEmptyObjects method to erase empty objects in AutoCAD 2010. But database class hasn't EraseEmptyObjects  method in Autocad 2008.I use ILSPY Tool to view the source code.

// Autodesk.AutoCAD.DatabaseServices.Database
public int EraseEmptyObjects(int flags)
{
    return <Module>.AcDbDatabase.eraseEmptyObjects(this.GetImpObj(), flags);
}

// <Module>
[SuppressUnmanagedCodeSecurity]
[DllImport("", CallingConvention = CallingConvention.ThisCall, SetLastError = true)]
[MethodImpl(MethodImplOptions.Unmanaged)]
public unsafe static extern uint eraseEmptyObjects(AcDbDatabase*, uint);

The code dosen't work in Autocad 2008 when I copy the code directly  into visual studio .

How to erase the empty object use PInvoke in Autocad 2008?
« Last Edit: August 19, 2015, 09:07:21 PM by guohq »