構文
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);
(JavaScript用) string GetStairsJS();
カレントのオブジェクトが、階段の場合、その情報を取得します。
パラメータ
- 0直進階段
- 1踊り場のある直進階段
- 2L字階段
- 3U字階段
- 4中空き階段
- 5S字階段
- 6円形階段
- 0平坦(1段)
- 12段
- 23段
- 34段(60度/30度)
- 44段(45度)
- 55段
- 66段
- 7上部2段、下部1段
- 8上部3段、下部1段
- 9上部1段、下部2段
- 10上部1段、下部3段
- 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(TEXT("何もない"));
while(lRet){
ULONG uType = m_MadoriDoc->GetCurrentObjectType();
short nLayer = m_MadoriDoc->GetCurrentObjectLayer();
CString strMsg;
strMsg.Format(TEXT("[%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(TEXT("直進階段 step[%u]depth[%lf]"), uStep1, dStepDepth1);
break;
case 1: // 踊り場のある直進階段
strMsg.Format(TEXT("踊り場のある直進階段 step[%u,%u]depth[%lf]landdepth[%lf]"),
uStep1, uStep2, dStepDepth1, dStepDepth2);
break;
case 2: // L字階段
strMsg.Format(TEXT("L字階段 step[%u,%u]landstep[%u]depth[%lf,%lf]"),
uStep1, uStep2, uLandStep1, dStepDepth1, dStepDepth2);
break;
case 3: // U字階段
strMsg.Format(TEXT("U字階段 step[%u,%u]landstep[%u]depth[%lf]"),
uStep1, uStep2, uLandStep1, dStepDepth1);
break;
case 4: // 中空き階段
strMsg.Format(TEXT("中空き階段 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(TEXT("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(TEXT("pos[%lf,%lf]w[%lf]turn[%u]ang[%lf]riser[%u]\nleft stringer[%u]")
TEXT("wall rail[%u]base[%u]hand rail[%u]bar[%lf] \nright stringer[%u]")
TEXT("wall rail[%u]base[%u]hand rail[%u]bar[%lf]\nframe l[%u]r[%u]")
TEXT("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();
}
// JavaScript sample
var doc = new CMadoriDoc();
var lRet = doc.GetTopObject();
while(lRet){
var uType =doc.GetCurrentObjectType();
alert(uType);
switch (uType){
case 12: // stairs
case 13: // STRAIGHTSTAIRS
case 14: // straightland
case 15: // lsign
case 16: // usign
case 17: // kosign
case 18: // ssign
var data = eval( doc.GetStairsJS() );
var msg = "GetStairsJS Result[" + data.Result + "]";
alert(msg);
msg = " XPos[" + data.XPos + "]\r\n";
msg += " YPos[" + data.YPos + "]\r\n";
msg += " Width[" + data.Width + "]";
alert(msg);
msg = " StairsType[" + data.StairsType + "]\r\n";
msg += " StepDepth1[" + data.StepDepth1 + "]\r\n";
msg += " StepDepth2[" + data.StepDepth2 + "]\r\n";
msg += " StepDepth3[" + data.StepDepth3 + "]";
alert(msg);
msg = " Step1[" + data.Step1 + "]\r\n";
msg += " Step2[" + data.Step2 + "]\r\n";
msg += " Step3[" + data.Step3 + "]\r\n";
msg += " LandStep1[" + data.LandStep1 + "]\r\n";
msg += " LandStep2[" + data.LandStep2 + "]";
alert(msg);
msg = " Turn[" + data.Turn + "]\r\n";
msg += " Angle[" + data.Angle + "]\r\n";
msg += " Riser[" + data.Riser + "]";
alert(msg);
msg = " LeftStringer[" + data.LeftStringer + "]\r\n";
msg += " LeftWallRail[" + data.LeftWallRail + "]\r\n";
msg += " LeftWallBase[" + data.LeftWallBase + "]\r\n";
msg += " LeftHandRail[" + data.LeftHandRail + "]\r\n";
msg += " LeftBarHeight[" + data.LeftBarHeight + "]";
alert(msg);
msg = " RightStringer[" + data.RightStringer + "]\r\n";
msg += " RightWallRail[" + data.RightWallRail + "]\r\n";
msg += " RightWallBase[" + data.RightWallBase + "]\r\n";
msg += " RightHandRail[" + data.RightHandRail + "]\r\n";
msg += " RightBarHeight[" + data.RightBarHeight + "]";
alert(msg);
msg = " LeftFrame[" + data.LeftFrame + "]\r\n";
msg += " RightFrame[" + data.RightFrame + "]\r\n";
msg += " LeftPanel[" + data.LeftPanel + "]\r\n";
msg += " RightPanel[" + data.RightPanel + "]\r\n";
msg += " External[" + data.External + "]\r\n";
msg += " Cut[" + data.Cut + "]\r\n";
msg += " Dir[" + data.Dir + "]";
alert(msg);
break;
}
lRet = doc.GetNextObject();
}