V5-工程圖標(biāo)準(zhǔn)的建立

在利用TPS視圖投影生成工程圖時(shí),遇到了這樣一個(gè)問(wèn)題,CATIA提示一下錯(cuò)誤:

“如果3D視圖和工程圖使用不同標(biāo)準(zhǔn),則無(wú)法生成視圖。請(qǐng)使用與3D視圖相同的標(biāo)準(zhǔn)創(chuàng)建視圖,然后重新啟動(dòng)該命令”

這是因?yàn)樵倮肅AA創(chuàng)建工程圖后,為了保險(xiǎn)起見(jiàn),需要對(duì)工程圖的標(biāo)準(zhǔn)進(jìn)行設(shè)定。

// Gets the drawing feature using the CATIDftDocumentServices interface

? CATIDrawing *piDrawing = NULL;

? CATIDftDocumentServices *piDftDocServices = NULL;

? CATIContainer_var spDrwcont;

? CATISpecObject_var spSpecObj;

? if (SUCCEEDED(pDoc->QueryInterface(IID_CATIDftDocumentServices, (void **)&piDftDocServices)))

? {

? ? ? ? ? //?pDoc為創(chuàng)建的工程圖文檔

?????????? piDftDocServices->GetDrawing(IID_CATIDrawing, (void **)&piDrawing);

?????????? piDftDocServices->Release();

????????piDftDocServices = NULL;

?????? spSpecObj=piDrawing;

? ? ?? if (spSpecObj != NULL_var) spDrwcont = spSpecObj->GetFeatContainer();

? }

? if (spDrwcont != NULL_var)

? {

? ? ? ? ? CATIDftStandardManager *piStdmgr = NULL;

?????????? HRESULT rc = spDrwcont->QueryInterface(IID_CATIDftStandardManager,(void**)&piStdmgr);

?????????? if (SUCCEEDED(rc))

?????????? {

?????????????????? //? Find a standard in the list of allowed standards (ie. the list of .CATDrwSTD files in the reffiles directory)

?????????????????? CATIStringList *piListstd = NULL;

?????????????????? if ( SUCCEEDED(piStdmgr->GetAvailableStandards(&piListstd)) && piListstd )

?????????????????? {

?????????????????????????? unsigned int? nbrstd = 0;

?????????????????????????? piListstd->Count(&nbrstd);

?????????????????????????? for (unsigned int indice = 0; indice < nbrstd; indice ++)

?????????????????????????? {

?????????????????????????????????? wchar_t? *wstd = NULL;

?????????????????????????????????? if ( SUCCEEDED ( piListstd->Item ( indice, &wstd ) )? && wstd )

?????????????????????????????????? {

???????????????????????????????????????????CATUnicodeString stdname;

?????????????????????????????????????????? const CATUnicodeString ANSI_UncS = "ANSI";

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? stdname.BuildFromWChar(wstd);

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? if ( stdname == ANSI_UncS )?

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? {

?????????????????????????????????????????????????? // Import the ANSI standard in the document

?????????????????????????????????????????????????? piStdmgr->ImportStandard (wstd);

?????????????????????????????????????????????????? break;

?????????????????????????????????????????? }

?????????????????????????????????? }

?????????????????????????????????? if (wstd) {delete[] wstd; wstd = NULL;}

?????????????????????? }

?????????????????????? piListstd->Release(); piListstd=NULL;? ? ? ? ? ?

?????????????????? }

?????????????????? piStdmgr->Release (); piStdmgr=NULL;

?????????????? }

? }

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容