如何设置系统变量?
VB开发|黄洪辉|2018-05-30 10:48
-
回答:
主要用到函数说明:
MxDrawXCustomFunction::Mx_SetSysVar
设置系统变量。详细说明如下:
参数 说明 CString sVarName
系统变量名
Value
需要设置的值
设置系统变量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);