www.mxdraw.com
|
扩展的打开文件函数,可以设置读取的内容
static bool Mx_OpenDwgEx(IN CString sFileName, IN LONG lReadRc, IN CString sPassword);
参数 |
说明 |
IN CString sFileName |
文件路径 |
IN LONG lReadRc |
指定需要读取的内容,不需要读取的内容可以不读取,这样能提高读取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值也为真,因为自定义实体需要名柄支持. }; |
IN CString sPassword |
文件密码,没有密码传空字符串. |
isIsPartial |
是否局部加载 |
例如:
MxDrawXLib.MxDrawResbuf param = new MxDrawResbuf(); param.AddString("H:\20150208214210.dwg"); param.AddLong(0); param.AddString("password"); axMxDrawX1.CallEx("Mx_OpenDwgEx", param);
例如: C#代码,局部加载,不加载组的调用
MxDrawXLib.MxDrawResbuf param = new MxDrawResbuf(); param.AddString("H:\test.dwg"); param.AddLong(~0x20); param.AddString(""); param.AddLong(1); axMxDrawX1.CallEx("Mx_OpenDwgEx", param);
例如: C#代码,最快的速加载图纸,图纸内部看不见的数据,不加载
MxDrawXLib.MxDrawResbuf param = new MxDrawResbuf(); param.AddString("H:\test.dwg"); param.AddLong(131072); axMxDrawX1.CallEx("Mx_OpenDwgEx", param);
例如: JS代码,最快的速加载图纸,图纸内部看不见的数据,不加载
var param = ocx.NewResbuf(); param.AddString("H:test.dwg"); param.AddLong(131072); ocx.CallEx("Mx_OpenDwgEx", param);