文件名称:C# AUTOCAD二次开发
文件大小:933KB
文件格式:RAR
更新时间:2018-03-30 17:49:22
C#
public ObjectId GetBlockTableRecordObjectId(string btrName) { ObjectId btrObjId = new ObjectId(); Database db = HostApplicationServices.WorkingDatabase; Transaction trans = db.TransactionManager.StartTransaction(); try { BlockTable bt = (BlockTable)trans.GetObject(db.BlockTableId, OpenMode.ForRead); BlockTableRecord btr = (BlockTableRecord)trans.GetObject((bt[btrName]), OpenMode.ForWrite); btrObjId = btr.ObjectId; trans.Commit(); } catch (Autodesk.AutoCAD.Runtime.Exception e) { //放弃事务 trans.Abort(); } finally { trans.Dispose(); } return btrObjId; }
【文件预览】:
HelloArx
----HelloArx.suo(18KB)
----UpgradeLog.XML(3KB)
----_UpgradeReport_Files()
--------UpgradeReport.xslt(12KB)
--------UpgradeReport_Minus.gif(69B)
--------UpgradeReport.css(3KB)
--------UpgradeReport_Plus.gif(71B)
----HelloArx()
--------HelloArx.csproj.user(307B)
--------bin()
--------NewCmd.cs(889B)
--------obj()
--------Class1.cs(4KB)
--------HelloArx.csproj(3KB)
--------Properties()
----HelloArx.sln(914B)
----Backup()
--------HelloArx.suo(8KB)
--------HelloArx()
--------HelloArx.sln(913B)