構文
BOOL GetStairs(double * dXPos, double * dYPos, double * dWidth, WORD
* uStairsType,
double * dStepDepth1, double * dStepDepth2, double * dStepDepth3,
unsigned short * uStep1, unsigned short * uStep2, unsigned short
* uStep3,
unsigned short * uLandStep1, unsigned short * uLandStep2,
unsidned short * bTurn,
double * dAngle,
unsidned short * bRiser,
unsidned short * bLeftStringer, unsidned short * bLeftWallRail,
unsidned short * bLeftWallBase,
unsidned short * bLeftHandRail, double * dLeftBarHeight,
unsidned short * bRightStringer, unsidned
short * bRightWallRail, unsidned short * bRightWallBase,
unsidned short * bRightHandRail, double * dRightBarHeight,
unsidned short * bLeftFrame, unsidned short * bRightFrame,
unsidned short * bLeftPanel, unsidned short * bRightPanel,
unsidned short * bExternal,
unsigned short * uCut, unsigned short * uDir);
カレントのオブジェクトが、階段の場合、その情報を取得します。
パラメータ
- 0直進階段
- 1踊り場のある直進階段
- 2L字階段
- 3U字階段
- 4中空き階段
- 5S字階段
- 0カット表示しない
- 11/3カット
- 0なし
- 1UP
- 2UP/DN
- 3上ル
- 4上ル/下ル
戻り値
階段の情報を取得できた場合 0 以外を返します。できなかった場合は 0 を返します。
使用例
// 間取りオブジェクトへ接続 CMadoriDoc * m_MadoriDoc = new CMadoriDoc(); CLSIDFromProgID (L"MyHomeDesignerMadori.MadoriDoc", &clsid); GetActiveObject (clsid, NULL, &pUnk); pUnk->QueryInterface (IID_IDispatch, (void**)(&pDisp)); m_MadoriDoc->AttachDispatch (pDisp); // 列挙する long lRet = m_MadoriDoc->GetTopObject(); if(lRet == 0) AfxMessageBox("何もない"); while(lRet){ ULONG uType = m_MadoriDoc->GetCurrentObjectType(); short nLayer = m_MadoriDoc->GetCurrentObjectLayer(); CString strMsg; strMsg.Format("[%X]type[%d]layer[%d]", lRet, uType,nLayer); AfxMessageBox(strMsg); lRet = m_MadoriDoc->GetNextObject(); switch(uType){ case 12: // stairs case 13: // STRAIGHTSTAIRS case 14: // straightland case 15: // lsign case 16: // usign case 17: // kosign case 18: // ssign { double dXPos, dYPos, dWidth; unsigned short uStairsType; double dStepDepth1, dStepDepth2, dStepDepth3; unsigned short uStep1, uStep2, uStep3, uLandStep1, uLandStep2, bTurn; double dAngle; unsigned short bRiser, bLeftStringer, bLeftWallRail, bLeftWallBase, bLeftHandRail; double dLeftBarHeight; unsigned short bRightStringer, bRightWallRail, bRightWallBase, bRightHandRail; double dRightBarHeight; unsigned short bLeftFrame, bRightFrame, bLeftPanel,bRightPanel, bExternal, uCut, uDir; m_MadoriDoc->GetStairs(&dXPos, &dYPos, &dWidth, &uStairsType, &dStepDepth1, &dStepDepth2, &dStepDepth3, &uStep1, &uStep2, &uStep3, &uLandStep1, &uLandStep2, &bTurn, &dAngle, &bRiser, &bLeftStringer, &bLeftWallRail, &bLeftWallBase, &bLeftHandRail, &dLeftBarHeight, &bRightStringer, &bRightWallRail, &bRightWallBase, &bRightHandRail, &dRightBarHeight, &bLeftFrame, &bRightFrame, &bLeftPanel, &bRightPanel, &bExternal, &uCut, &uDir); switch(uStairsType){ case 0: // 直進階段 strMsg.Format("直進階段 step[%u]depth[%lf]", uStep1, dStepDepth1); break; case 1: // 踊り場のある直進階段 strMsg.Format("踊り場のある直進階段 step[%u,%u]depth[%lf]landdepth[%lf]", uStep1, uStep2, dStepDepth1, dStepDepth2); break; case 2: // L字階段 strMsg.Format("L字階段 step[%u,%u]landstep[%u]depth[%lf,%lf]", uStep1, uStep2, uLandStep1, dStepDepth1, dStepDepth2); break; case 3: // U字階段 strMsg.Format("U字階段 step[%u,%u]landstep[%u]depth[%lf]", uStep1, uStep2, uLandStep1, dStepDepth1); break; case 4: // 中空き階段 strMsg.Format("中空き階段 step[%u,%u,%u]landstep[%u,%u]depth[%lf,%lf,%lf]", uStep1, uStep2, uStep3, uLandStep1, uLandStep2, dStepDepth1, dStepDepth2, dStepDepth3); break; case 5: // S字階段 strMsg.Format("S字階段 step[%u,%u,%u]landstep[%u,%u]depth[%lf,%lf,%lf]", uStep1, uStep2, uStep3, uLandStep1, uLandStep2, dStepDepth1, dStepDepth2, dStepDepth3); break; } AfxMessageBox(strMsg); strMsg.Format("pos[%lf,%lf]w[%lf]turn[%u]ang[%lf]riser[%u]\nleft stringer[%u]" "wall rail[%u]base[%u]hand rail[%u]bar[%lf] \nright stringer[%u]" "wall rail[%u]base[%u]hand rail[%u]bar[%lf]\nframe l[%u]r[%u]" "panel l[%u]r[%u]external[%u]cut[%u]dir[%u]", dXPos, dYPos, dWidth, bTurn, dAngle, bRiser, bLeftStringer, bLeftWallRail, bLeftWallBase, bLeftHandRail, dLeftBarHeight, bRightStringer, bRightWallRail, bRightWallBase, bRightHandRail, dRightBarHeight, bLeftFrame, bRightFrame, bLeftPanel, bRightPanel, bExternal, uCut, uDir); AfxMessageBox(strMsg); } break; } lRet = m_MadoriDoc->GetNextObject(); }