|
Acad::ErrorStatus es;
ads_name ent;
ads_point pt;
AcDbObjectId Id;
LPDISPATCH pDisp;
VARIANT pArrayObjs;
HRESULT hr;
BeginEditorCommand();
if (m_ss[0]!=0L||m_ss[1]!=0L)
{
//acedSSFree(m_ss);
m_ss[0] = m_ss[1] = 0L;
}
//acedSSGet(_T(":S"),NULL,NULL,NULL,m_ss);
if (acedEntSel(_T("\n请选择对象..."),m_ss,pt)==RTNORM)
{
CompleteEditorCommand();
//通过对象标识转换函数得到为对象id
es=acdbGetObjectId(Id,m_ss);
if (Acad::eOk==es)
{
acutPrintf(_T("\n选择对象成功,开始阵列"));
pDisp = acedGetAcadWinApp()->GetIDispatch(TRUE);
VariantInit(&pArrayObjs);
V_VT(&pArrayObjs)=VT_ARRAY|VT_DISPATCH;
hr=AcAxArrayRectangular(Id,pDisp,1,3,1,1,20,1,&pArrayObjs);
if (SUCCEEDED(hr))
{
acutPrintf(_T("\n成功"));
}
else if(FAILED(hr))
{
acutPrintf(_T("\n失败"));
}
}
else{
acutPrintf(_T("error"));
}
}
else
{
CancelEditorCommand();
} |
|