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;
Thanks
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)
{
:elete_Session(iDocSessionName);
}
}
{
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)
{
:elete_Session(iDocSessionName);
}
}
Thanks