2014-10-12 80 views
0

我想在C++中打開sketchup模型。我下載了sdk,編譯了這個例子,但是,當我嘗試運行它時,它不會讀取任何臉部,型號名稱,也不會讀取任何內容。有人能幫助我嗎?sketchup C++ api閱讀skp文件

SUInitialize(); 
// Load the model from a file 
SUModelRef model = SU_INVALID; 
SUResult res = SUModelCreateFromFile(&model, "model.skp"); 
if (res != SU_ERROR_NONE) 
{ 
    std::cout << "error" << std::endl; 
    return 1; 
} 
// Get the entity container of the model. 
SUEntitiesRef entities = SU_INVALID; 
SUModelGetEntities(model, &entities); 

size_t faceCount = 0; 
SUEntitiesGetNumFaces(entities, &faceCount); 

// faceCount = 0..., why???!!! 

回答

1

這將返回僅在模型根部的面數,而不是在任何組件或組內的面數。 model.skp是否有空閒的面孔? (即不在組件內部)