当前位置: 主页 > 活动 > 详情
新建一个DWG把当前图形中的块复制过去_天天热议

互联网   2023-07-03 11:53:55


(资料图片)

private void btnSave_Click(object sender, EventArgs e) { //定义数据库 Database db = HostApplicationServices.WorkingDatabase; if (dicIds.Count < 11) return; using (Transaction trans = db.TransactionManager.StartTransaction()) { Database dbNew = new Database(true, true); //获取所选实体的ObjectId集合 ObjectIdCollection ids = new ObjectIdCollection(); foreach (var dic in dicIds) { ids.Add(dic.Value); } var msId = SymbolUtilityServices.GetBlockModelSpaceId(dbNew); var mapping = new IdMapping(); dbNew.WblockCloneObjects(ids, msId, mapping, DuplicateRecordCloning.Ignore, false); string sPath = ConSQL.DirUserSetting + "\\Sign\\"; dbNew.SaveAs(sPath + tbName.Text + ".dwg", DwgVersion.AC1027); trans.Commit(); } }
相关资讯