guohq 发表于 2016-3-11 05:58:49

如何将块保存为单个文件?

(命令 “-wblock” newBlockFilePath blockName)
我可以使用lisp将块保存为单个文件。
如何实现此使用 .net?
**** Hidden Message *****

BillZndl 发表于 2016-3-11 07:44:44

查看WBlockCloneObjects。
////将所有objectId克隆到新图形,并将其保存到路径& filename。。

Database newdata =新数据库(true,true);。
string sav Path = @ " C:\ Path \ "+DwgName;。

使用(Transaction ntrans = newdata,transaction manager . start transaction())。
{。
block table record new btr =(block table record)ntrans,GetObject(SymbolUtilityServices,GetBlockModelSpaceId(newdata),OpenMode。for read);。

id mapping id map = new id mapping();。

数据库,WblockCloneObjects(oidc,newbtr。ObjectId,IDMap,DuplicateRecordCloning。替换,假);。

新数据,另存为(SavPath,DwgVersion。当前);。

ntrans,commit();。
} 。

guohq 发表于 2016-3-11 11:24:51

查看WBlockCloneObjects。
////将所有objectId克隆到新图形,并将其保存到路径& filename。。

Database newdata =新数据库(true,true);。
string sav Path = @ " C:\ Path \ "+DwgName;。

使用(Transaction ntrans = newdata,transaction manager . start transaction())。
{。
block table record new btr =(block table record)ntrans,GetObject(SymbolUtilityServices,GetBlockModelSpaceId(newdata),OpenMode。for read);。

id mapping id map = new id mapping();。

数据库,WblockCloneObjects(oidc,newbtr。ObjectId,IDMap,DuplicateRecordCloning。替换,假);。

新数据,另存为(SavPath,DwgVersion。当前);。

ntrans,commit();。
} 。
谢谢您!。

BillZndl 发表于 2016-3-11 12:08:15

不客气!
页: [1]
查看完整版本: 如何将块保存为单个文件?