你怎么还在用COM呀!用COM的过时了,现在直接用DLL,直接在CAD里加载即可!- Using trans As Transaction = db.TransactionManager.StartTransaction
- Dim bt As BlockTable = trans.GetObject(db.BlockTableId, OpenMode.ForRead)
- Dim btr As BlockTableRecord = trans.GetObject(bt.Item(BlockTableRecord.ModelSpace), OpenMode.ForWrite)
- For Each Id As ObjectId In btr
- Dim obj As DBObject = trans.GetObject(Id, OpenMode.ForRead)
- ed.WriteMessage(vbCrLf & obj.GetType.ToString)
- Next
- End Using
|