構文
BSTR GetCADLayerName(USHORT n);
CADレイヤ名を取得します。
パラメータ
n
名前を取得したいレイヤが何番目かを0からの数値で指定します。
使用例
// C++ sample
// 間取りオブジェクトへ接続
CMadoriDoc * m_MadoriDoc = new CMadoriDoc();
CLSIDFromProgID (L"MyHomeDesignerMadori.MadoriDoc", &clsid);
GetActiveObject (clsid, NULL, &pUnk);
pUnk->QueryInterface (IID_IDispatch, (void**)(&pDisp));
m_MadoriDoc->AttachDispatch (pDisp);
// 下絵読み込み
if(!m_MadoriDoc->CADDataOpen(L"C:\\Users\\Public\\Documents\\aaa.dxf", 1.0)){
// エラー
return;
}
// レイヤ数を確認
USHORT uNum = m_MadoriDoc->GetCADLayerNum();
for(USHORT u = 0; u < uNum; ++u){
BSTR bstr = m_MadoriDoc->GetCADLayerName(u);
// 何か処理
// ...
// 解放
::SysFreeString(bstr);
}
// JavaScript sample
var doc = new CMadoriDoc();
var num = doc.GetCADLayerNum();
alert(num);
var u;
for(u=0; u < num; ++u){
var layerName = doc.GetCADLayerName(u);
alert(layerName);
}