Purging Orphaned Data

I am trying to purge Orphaned data programmatically, with send command

dwgfile.sendcommand("-PURGE" & vbCr & "O" & vbCr)

but, it gives: Object of class AcDbDictionary can't be cast to AcDbEntity. in BricsCAD commandline for version 25.1.07

Please help me out regarding this. I want to purge orphaned data, as my file size is more than 20 MB.

Comments