本帖最后由 lzh741206 于 2010-12-12 19:35 编辑
2010/12/12更新
程序示例
- using (var tr = new DBTransaction())
- {
- //裁剪块参照
- var ed = tr.Editor;
- var resEnt = ed.GetEntity("\n选择块参照");
- var resPt1 = ed.GetPoint("\n选择第一角点");
- var resPt2 = ed.GetCorner("\n选择第二角点", resPt1.Value);
- var bref = tr.GetObject<BlockReference>(resEnt.ObjectId);
- tr.ClipBlockRef(bref, resPt1.Value, resPt2.Value);
- }
- using (var tr = new DBTransaction())
- {
- //从文件中获取块定义示例
- ObjectId id = tr.GetBlockFromFile("d://1.dwg", "a", true);
- var btr = tr.OpenCurrentSpace();
- tr.InsertBlockRef(id);
- }
- using (var tr = new DBTransaction())
- {
- //从文件中获取标注样式示例
- tr.Database.Dimstyle = tr.GetDimStyleFromFile("d://1.dwg", "JZ", true);
- }
- using (var tr = new DBTransaction())
- {
- //在字典中保存扩展数据
- ResultBuffer rb = new ResultList { { 10, Point3d.Origin } };
- tr.SetXRecord(rb, "TlsCad", "ABC");
- }
- using (var tr = new DBTransaction())
- {
- //Zoom示例
- var ed = tr.Editor;
- Line l = new Line(Point3d.Origin, new Point3d(10, 10, 0));
- var btr = tr.OpenCurrentSpace();
- tr.AddEntity(btr, l);
- ed.ZoomObject(l);
- }
|