www.mxdraw.com
|
设置系统变量.
static BOOL Mx_SetSysVar(CString sVarName, Value);
参数 |
说明 |
CString sVarName |
系统变量名 |
Value |
需要设置的值。 |
成功返回TRUE.
例如: VB 设置系统变量DYNINPUT值为0
Dim param As MxDrawResbuf Set param = New MxDrawResbuf param.AddString "DYNINPUT" param.AddLong 0, 5010 '5010 = RTLONG MxDrawX1.CallEx "Mx_SetSysVar", param
例如: 设置图层
Dim param As MxDrawResbuf Set param = New MxDrawResbuf param.AddString "CLAYER" param.AddString "图层1", 5005 ' 5005 = RTSTR,代码是一个字符串类型的值 MxDrawX1.CallEx "Mx_SetSysVar", param
设置线型 例如:
Dim param As MxDrawResbuf Set param = New MxDrawResbuf param.AddString "CELTYPE" param.AddString "DOT", 5005 ' 5005 = RTSTR,代码是一个字符串类型的值 MxDrawX1.CallEx "Mx_SetSysVar", param
例如:
设置线型设置颜色. Dim param As MxDrawResbuf Set param = New MxDrawResbuf param.AddString "CECOLOR" param.AddLong 255, 5010 ' 5010 = RTLONG,代码是长整型变量的值,255是RGB组合值。 MxDrawX1.CallEx "Mx_SetSysVar", param
例如: 设置栅格,和栅格距离
// 打开栅格捕捉 axMxDrawX1.SetSysVarLong("GRIDMODE", 1); // 设置捕捉间距 MxDrawResbuf param = new MxDrawResbuf(); MxDrawPoint ptSNAPUNIT = new MxDrawPoint(); ptSNAPUNIT.x = 500; ptSNAPUNIT.y = 500; param.AddString("SNAPUNIT"); param.AddPointEx(ptSNAPUNIT,5002); axMxDrawX1.CallEx("Mx_SetSysVar", param);
例如:
修改图纸的字符编码 MxDrawResbuf param = new MxDrawResbuf(); param.AddString ("DWGCODEPAGE"); param.AddString ("ansi_936"); MxDrawApplication app = new MxDrawApplication(); app.CallEx("Mx_SetSysVar", param);