아래 코드를 참조하시기 바랍니다.
DgnIndexItemP indexItem = NULL;
DgnIndexIteratorP pIterator = mdlModelIterator_create(mdlModelRef_getDgnFile (mdlModelRef_getActive()));
while(NULL != (indexItem = mdlModelIterator_getNext (pIterator)))
{
ModelID modelId = mdlModelItem_getModelID (indexItem);
DgnModelRefP pModel = NULL;
mdlModelRef_createWorking (&pModel,mdlModelRef_getDgnFile(mdlModelRef_getActive ()),modelId,TRUE,TRUE);
if(mdlModelRef_isSheet (pModel))
{
CDgnSheet DgnSheet(pModel);
DgnSheet.GetSheetDefInfo();
//! sheet 정보를 text 파일로 출력(테스트용)
DgnSheet.WriteToFile(_T("C:\\TEST.txt"));
}
mdlModelRef_freeWorking (pModel);
}
/*
@brief get sheet definition
@author humkyung
@date 2011.07.04
**/
int CDgnSheet::GetSheetDefInfo()
{
if (mdlModelRef_isSheet (m_pModelRef))
{
SheetDef *pSheetDef = NULL;
//! sheet definition 생성(mdlSheetDef_new 함수를 통해서만 sheet definition을 생성할 수 있다)
pSheetDef = mdlSheetDef_new ();
mdlModelRef_getSheetDef (m_pModelRef, pSheetDef);
m_modelId = mdlModelRef_getModelID (m_pModelRef);
mdlSheetDef_getColor (pSheetDef,&m_iColor);
mdlSheetDef_getOrigin (pSheetDef,&m_origin);
mdlSheetDef_getRotation (pSheetDef,&m_dRotation);
mdlSheetDef_getScaleFactor (pSheetDef,&m_drawingScale,SHEET_SCALE_TYPE_DRAWING_SCALE);
mdlSheetDef_getScaleFactor (pSheetDef,&m_geometryScale,SHEET_SCALE_TYPE_GEOMETRY_SCALE);
m_GeometryAtDrawingScale = mdlSheetDef_isGeometryAtDrawingScale (pSheetDef);
mdlSheetDef_getScaleFactor (pSheetDef,&m_annotationScale,SHEET_SCALE_TYPE_ANNOTATION_SCALE);
mdlSheetDef_getSize (pSheetDef,&m_dSizeWidth, &m_dSizeHeight);
mdlSheetDef_getUnits (pSheetDef,&m_units);
//! sheet도 하나의 모델이므로 모델 이름이 sheet 이름이 된다.
mdlModelRef_getModelName(m_pModelRef , m_szSheetName);
mdlSheetDef_free (&pSheetDef);
return SUCCESS;
}
return ERROR;
}
댓글
댓글 쓰기