acedCommand调用laydel

HKL hkl_old=NULL;

//将输入法修改回来

#ifdef _WIN64

void CALLBACK TimerProc_ChangeBackHKL(HWND hWnd, UINT nMsg, UINT_PTR nTimerId, DWORD dwTime)

#else

void CALLBACK TimerProc_ChangeBackHKL(HWND hWnd, UINT nMsg, UINT nTimerId, DWORD dwTime)

#endif

{

KillTimer(hWnd,nTimerId);

ActivateKeyboardLayout(hkl_old,KLF_SETFORPROCESS);//激活输入法

};

//强制删除图形中的云线图层(laydel)

void _QCYX()

{

AcDbDatabase* pDb=acdbHostApplicationServices()->workingDatabase();

CString strLayerNameCur;

GetLayerName(strLayerNameCur,pDb->clayer());

if(strLayerNameCur.Find(_T(“云线”))==0

||strLayerNameCur.Find(_T(“云线_”))>=0)

{

pDb->setClayer(pDb->layerZero());

acutPrintf(_T(“\n将当前图层设置为0层\n”));

}

//强制删除云线图层

AcDbObjectId layerId_YX;

Acad::ErrorStatus es=GetLayerId(layerId_YX,_T(“云线”));

if(Acad::eOk!=es)

{

acutPrintf(_T(“\n寻找云线图层失败\n”));

return;

}

acedCommand(RTSTR,_T(“-laydel”),RTSTR,_T(“N”),RTSTR,_T(“云线”),RTNONE);

keybd_event(VK_RETURN,0,0,0);

Sleep(20);

keybd_event(VK_RETURN,0,KEYEVENTF_KEYUP,0);

Sleep(20);

keybd_event(‘Y’,0,0,0);

Sleep(20);

keybd_event(‘Y’,0,KEYEVENTF_KEYUP,0);

Sleep(20);

keybd_event(VK_RETURN,0,0,0);

Sleep(20);

keybd_event(VK_RETURN,0,KEYEVENTF_KEYUP,0);

Sleep(20);

}

//去除云线

void QCYX()

{

hkl_old=GetKeyboardLayout(GetCurrentThreadId());

HKL hkl;

hkl=LoadKeyboardLayout(_T(“00000409”),KLF_ACTIVATE);//装载输入法

if(hkl!=NULL)

ActivateKeyboardLayout(hkl,KLF_SETFORPROCESS);//激活输入法

_QCYX();

acedCommand(RTSTR,_T(“regen”),RTNONE);

//启动定时器

SetTimer(acedGetAcadFrame()->GetSafeHwnd(), 257+12, 50, TimerProc_ChangeBackHKL);

}

 

此条目发表在ObjectArx分类目录,贴了, 标签。将固定链接加入收藏夹。

发表评论