Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

CAT

Status
Not open for further replies.

NaWin55

Mechanical
Joined
Mar 21, 2020
Messages
98
Location
IN
HI

i just started learning CAA c++ customization i have written code to create session and create PART Document
but the code is opening catia but not creating PART document


here is the script

#include <iostream>
#include "CATSession.h" //Header file to create Session
#include "CATSessionServices.h"
#include "CATDocumentServices.h"//Headr for document creation


using namespace std;

int main ()
{
char *iDocSessionName = "DocumentSession";
CATSession *oDocSession = NULL;
HRESULT hr = ::Create_Session(iDocSessionName,oDocSession);
if(SUCCEEDED(hr) && NULL != oDocSession)
cout<<"Session Created"<<endl;
else
{
cout<<"Failed to Create Session"<<endl;
return 0;
}

CATDocument *oDoc = NULL;
hr = CATDocumentServices :: New("Part",oDoc);
if(FAILED(hr) || NULL == oDoc)
{
cout<<"Failed in Creating Document"<<endl;
}
cout<<"Creted Document"<<endl;
if(NULL != iDocSessionName)
{
::Delete_Session(iDocSessionName);
}
}​

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top