马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
本帖最后由 csharp 于 2017-8-25 17:20 编辑
- [CommandMethod("ListProxy")]
- public void ListAllProxy()
- {
- Database db = HostApplicationServices.WorkingDatabase;
- Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
- using (Transaction tr=db.TransactionManager.StartTransaction())
- {
- BlockTable bt=(BlockTable)tr.GetObject(db.BlockTableId, OpenMode.ForRead);
- BlockTableRecord btr = (BlockTableRecord) tr.GetObject(db.CurrentSpaceId, OpenMode.ForRead);
- ed.WriteMessage("\nProxy Enity In Modelspace .....");
- foreach (ObjectId objectId in btr)
- {
- if (objectId.ObjectClass.Name == "AcDbZombieEntity")
- {
- var ent = (ProxyEntity)tr.GetObject(objectId, OpenMode.ForRead);
- ed.WriteMessage("\n{0};{1};{2};{3}",ent.Handle.ToString(), ent.ApplicationDescription,ent.ProxyFlags,ent.OriginalDxfName);
- }
- }
- var nod =(DBDictionary) tr.GetObject(db.NamedObjectsDictionaryId, OpenMode.ForRead);
- ed.WriteMessage("\nProxy Object in Dictionary .....");
- foreach (DBDictionaryEntry dbDictionaryEntry in nod)
- {
- var dict = tr.GetObject(dbDictionaryEntry.m_value, OpenMode.ForRead);
- if (dict.IsAProxy)
- {
- ed.WriteMessage("\n{0};{1};{2};{3}", dict.Handle.ToString(), ((ProxyObject) dict).ApplicationDescription,
- ((ProxyObject) dict).ProxyFlags, ((ProxyObject) dict).OriginalDxfName);
- }
- }
- tr.Commit();
- }
- }
命令: LISTPROXY
Proxy Enity In Modelspace .....
Proxy Object in Dictionary .....
2F7C50;ObjectDBX Classes;1024;RAPIDRTRENDERSETTINGS
17E3C3;"TCH_KERNAL|缺乏解释器天正图形看不见, 请下载天正插件|网址: www.tangent.com.cn";1;TCH_DBCONFIG
命令: 指定对角点或 [栏选(F)/圈围(WP)/圈交(CP)]: *取消*
|