SE API with C++/Create document

 

    SolidEdgeFramework::ApplicationPtr pSEApp;

    SolidEdgePart:Smiley TongueartDocumentPtr pPartDoc;

    SolidEdgePart:Smiley FrustratedheetMetalDocumentPtr pSheetMetalDoc;

    SolidEdgeAssembly::AssemblyDocumentPtr pAsmDoc;

    SolidEdgeDraft:Smiley Very HappyraftDocumentPtr pDraftDoc;

    HRESULT hr;

    IDispatchPtr pDispatch;

    hr=pSEApp.CreateInstance("SolidEdge.Application");

    pSEApp->Visible=VARIANT_TRUE;

    pSEApp->WindowState=2;

    if(hr==S_OK)

    {

        pDispatch=pSEApp->Documents->Add("SolidEdge.PartDocument",vtMissing);   

        hr=pDispatch->QueryInterface(&pPartDoc);

        if(hr==S_OK)

            MessageBox(pPartDoc->Name);

 

        pDispatch=pSEApp->Documents->Add("SolidEdge.SheetMetalDocument",vtMissing);

        hr=pDispatch->QueryInterface(&pSheetMetalDoc);

        if(hr==S_OK)

            MessageBox(pSheetMetalDoc->Name);

 

        pDispatch=pSEApp->Documents->Add("SolidEdge.AssemblyDocument",vtMissing);

        hr=pDispatch->QueryInterface(&pAsmDoc);

        if(hr==S_OK)

            MessageBox(pAsmDoc->Name);

 

        pDispatch=pSEApp->Documents->Add("SolidEdge.DraftDocument",vtMissing);

        hr=pDispatch->QueryInterface(&pDraftDoc);

        if(hr==S_OK)

            MessageBox(pDraftDoc->Name);

    }

    else

        MessageBox("Failed!");

 

Posted by: assassin 007
Post date: 5/16/2010 7:35:00 PM

2 REPLIES

RE: SE API with C++/Create document

Are you asking a question or just providing an example?

 

Posted by: Jason Newell
Post date: 5/16/2010 7:38:59 PM

RE: SE API with C++/Create document

Hi, Jason, I'm sorry! All are examples.

 

Posted by: assassin 007
Post date: 5/16/2010 7:54:51 PM