SE API with C++/Draft-section/sheet

Valued Contributor
Valued Contributor

 

    SolidEdgeFramework::ApplicationPtr pSEApp;

    SolidEdgeFramework:Smiley Very HappyocumentsPtr pDocs;

    SolidEdgeDraft:Smiley Very HappyraftDocumentPtr pDraftDoc;

    SolidEdgeDraft:Smiley FrustratedectionsPtr pSections;

    SolidEdgeDraft:Smiley FrustratedectionPtr pSection;

    SolidEdgeDraft:Smiley FrustratedectionSheetsPtr pSectionSheets;

    SolidEdgeDraft:Smiley FrustratedheetsPtr pSheets;

    SolidEdgeDraft:Smiley FrustratedheetPtr pSheet;

    CString format1;

    CString format2;

    IDispatchPtr pDispatch;

    HRESULT hr;

 

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

    pDocs=pSEApp->Documents;

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

    hr=pDispatch->QueryInterface(&pDraftDoc);

    pSections=pDraftDoc->Sections;

    int type;

    for(long i=1;iCount;i++)

    {

        pSection=pSections->Item(i);

        pSectionSheets=pSection->Sheets;

        type=(int)pSection->Type;

        format1.Format("%d",type);

        MessageBox(format1,"xx",0);

        for(long j=1;jCount;j++)

        {

            pSheet=pSectionSheets->Item(j);

            format2=pSheet->Name.Detach();

            MessageBox(format2);

        }

        pSection=pSections->WorkingSection;

        pSection=pSections->BackgroundSection;

        pSheets=pDraftDoc->Sheets;

        if(i==1)

            pSheet=pSheets->AddSheet("Sheet2",igWorkingSection,vtMissing,vtMissing);

        else if(i==2)

            pSheet=pSheets->AddSheet("Sheet3",igWorkingSection,vtMissing,vtMissing);

        else

            ;

        pSheet->Activate();

    }

 

 

Posted by: assassin 007
Post date: 5/16/2010 7:49:46 PM