www.mxdraw.com
|
插入块图
static BOOL Mx_InsertBlockEx(CString sFileName, CString sBlkName, INT iRC = kReadAll, CString sPassword = "", bool isUpdataSameNameBlock = false);
参数 |
说明 |
CString sFileName |
图块文件名. |
CString sBlkName |
图块的块名 |
INT iRC = kReadAll |
指定需要读取的内容,不需要读取的内容可以不读取,这样能提高读取dwg文件的速度,可以取如下值: enum ReadContent { kReadAll = 0xFFFFFFFF, // 取值为0自动变成kReadAll kReadNull = 0x0, // 下面数据都不读取 kReadExData = 0x1, kReadHandle = 0x2, kReadBlockRefPreviewIcon = 0x4, kReadBlockLayoutName = 0x8, kNamedObjectsDictionary = 0x10, // 是否读对象字典,如果不读,字典下所有数据都不会读取. kReadGroupDict = 0x20, // 是否读取组字典 kReadLayoutDict = 0x40, kReadMlineStyleDict = 0x80, kReadImageDict = 0x100, kReadXrecord = 0x200, kReadDrawOrder = 0x400, kReadxData = 0x800, kReadExRecord = 0x1000, kReadExternalReference = 0x2000, kReadCustomEntity = 0x4000 // 是否读取自定义实体,如果该为项为真,则自动让kReadHandle值也为真,因为自定义实体需要名柄支持. }; |
CString sPassword = "" |
文件读取密码. |
bool isUpdataSameNameBlock = false |
如果插入的数据库的图块名与当前数据库的图块名同名,需要不需要重新更新该图块。默认不是会更新的。 |
成功返回true.
例如: VB调用例子。
Dim param As MxDrawResbuf Set param = New MxDrawResbuf param.AddString "c:1.dwg" param.AddString "blknam" param.AddLong 0 param.AddString "password" MxDrawX1.CallEx "Mx_InsertBlockEx", param
例如: C#例子
MxDrawResbuf param = new MxDrawResbuf();
param.AddString("G:\1.dwg");
param.AddString("Test");
param.AddLong(0);
param.AddString("");
param.AddLong(1);
axMxDrawX1.CallEx("Mx_InsertBlockEx", param);
axMxDrawX1.DrawBlockReference(0, 0, "Test", 1.0, 0.0);
axMxDrawX1.ZoomAll();
axMxDrawX1.UpdateDisplay();