GetSlopedCeiling メソッド

構文

BOOL GetSlopedCeiling(VARIANT * vVertex);

カレントのオブジェクトが、勾配天井の場合、その情報を取得します。

パラメータ

vVertex
(x, y) 頂点列。型は VT_R8 | VT_ARRAY にしてください。vVertex.parrayは不要になったら、SafeArrayDestroyで解放してください。

戻り値

勾配天井の情報を取得できた場合 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 49: // sloped ceiling
		{
		VARIANT vVertex;
		vVertex.vt = VT_R8 | VT_ARRAY;
		vVertex.parray = NULL;
		m_MadoriDoc->GetSlopedCeiling(&vVertex);
		ULONG uVertex = 0;
		if(vVertex.parray){
			uVertex = vVertex.parray->rgsabound[0].cElements;
		}

		strMsg.Format("sloped ceiling v[%u]", uVertex);
		AfxMessageBox(strMsg);
		if(uVertex > 0){
			double * pVar;
			SafeArrayAccessData(vVertex.parray, (void**)&pVar);
			for(ULONG u = 0; u < uVertex; u+=2){
				strMsg.Format("Vertex %u[%lf,%lf]", u/2, pVar[u], pVar[u+1]);
				AfxMessageBox(strMsg);
			}
			SafeArrayUnaccessData(vVertex.parray);
		}

		if(vVertex.parray) SafeArrayDestroy(vVertex.parray);
		}
		break;
	}
	lRet = m_MadoriDoc->GetNextObject();
}

(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-5L3L45');