www.mxdraw.com
|
返回自定义实本,最小外包
[id(7)] void CustomEntity_getGeomExtents(IDispatch* pCustomEntity, DOUBLE* dMinX, DOUBLE* dMinY, DOUBLE* dMaxX, DOUBLE* dMaxY, LONG* pOk);
参数 |
说明 |
IDispatch* pCustomEntity |
IMxDrawCustomEntity对象 |
DOUBLE* dMinX |
最小外包左下角X |
DOUBLE* dMinY |
最小外包左下角Y |
DOUBLE* dMaxX |
最小外包右上角X |
DOUBLE* dMaxY |
最小外包右上角Y |
LONG* pOk |
返回值,成功回 1. |
例如: VC COM
void CTestVc2005Dlg::CustomEntity_getGeomExtentsMxdrawxctrl1(LPDISPATCH pCustomEntity, double* dMinX, double* dMinY, double* dMaxX, double* dMaxY, long* pOk) { // TODO: 在此处添加消息处理程序代码 *pOk = 1; IMxDrawCustomEntityPtr spDrawData; pCustomEntity->QueryInterface(&spDrawData); CString sGuid = spDrawData->Guid; if(sGuid == MX_CUSTOM_ENTITY_ID) { if(spDrawData->IsHave(_T("ept") ) != VARIANT_TRUE) return; IMxDrawPointPtr stp = spDrawData->GetPoint(_T("spt")); if(stp == NULL) return; IMxDrawPointPtr ept = spDrawData->GetPoint(_T("ept")); if(ept == NULL) return; *dMinX = stp->x; *dMinY = stp->y; *dMaxX = ept->x; *dMaxY = ept->y; } }