string kuaiPath = @"C:\Users\Yang\Desktop\管口方位图\KuangCS.dwg";
string templatePath = @"C:\Users\Yang\Desktop\管口方位图\sedinMB12007.dwg";
string savePath = @"C:\Users\Yang\Desktop\219.dwg";
using (Database pDb = new Database(false, false))
{
pDb.ReadDwgFile(templatePath, FileOpenMode.OpenForReadAndWriteNoShare, false, "");
// 从其他文件中获取块
using (Database kdb = new Database(false, false))
{
kdb.ReadDwgFile(kuaiPath, FileOpenMode.OpenForReadAndWriteNoShare, false, "");
using (BlockTable kTable = (BlockTable)kdb.BlockTableId.GetObject(OpenMode.ForRead)) // kTable等价于pTable
{
//using (BlockTable bt = (BlockTable)pDb.BlockTableId.Open(OpenMode.ForWrite))
using (BlockTable bt
Teigha从模板中导入块的方法
最新推荐文章于 2023-03-11 11:57:01 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)