Reply

SE API with C++/Draft--SmartFrame/Symbol/Create DrawingView

[ Edited ]

 

    SolidEdgeFramework::ApplicationPtr pSEApp;

    SolidEdgeFramework:Smiley Very HappyocumentsPtr pDocs;

    SolidEdgeDraft:Smiley Very HappyraftDocumentPtr pDraftDoc;

    SolidEdgeDraft:Smiley FrustratedheetPtr pSheet;

    SolidEdgeFrameworkSupport:Smiley FrustratedmartFrames2dPtr pSmartFrames;

    SolidEdgeFrameworkSupport:Smiley FrustratedmartFrame2dPtr pSmartFrame;

    IDispatchPtr pDispatch;

    HRESULT hr;

 

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

    pDocs=pSEApp->Documents;

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

    hr=pDispatch->QueryInterface(&pDraftDoc);

    pSheet=pDraftDoc->ActiveSheet;

    /*pDispatch=pSheet->SmartFrames2d;

    pDispatch->QueryInterface(&pSmartFrames);

    pSmartFrame=pSmartFrames->AddBy2Points("",0.2,0.2,0.7,0.7);

    pSmartFrame->Description="My SmartFrame";

    pSmartFrame->CreateEmbed("E:\\Velocity\\CAE\\femap toturial\\wallpaper\\a.jpg",vtMissing);

    pSmartFrame->CreateLink("E:\\Velocity\\CAE\\femap toturial\\wallpaper\\a.jpg",vtMissing);*/

 

    //SolidEdgeFramework:Smiley FrustratedymbolsPtr pSymbols;

    //SolidEdgeFramework:Smiley Frustratedymbol2dPtr pSymbol1;

    //SolidEdgeFramework:Smiley Frustratedymbol2dPtr pSymbol2;

    //SolidEdgeFramework:Smiley Frustratedymbol2dPtr pSymbol3;

 

    //pDispatch=pSheet->Symbols;

    //pDispatch->QueryInterface(&pSymbols);

    //pSymbol1=pSymbols->Add((long)SolidEdgeFramework:Smiley SurprisedLEInsertionTypeConstant::igOLELinked,"C:\\MyFile.docx",0.1,0.1,vtMissing);

    //pSymbol2=pSymbols->Add((long)SolidEdgeFramework:Smiley SurprisedLEInsertionTypeConstant::igOLEEmbedded,"C:\\MyFile.docx",0.1,0.2,vtMissing);

    //pSymbol3=pSymbols->Add((long)SolidEdgeFramework:Smiley SurprisedLEInsertionTypeConstant::igOLESharedEmbedded,"C:\\MyFile.docx",0.1,0.3,vtMissing);

    //

    //double x,y;

    //pSymbol1->GetOrigin(&x,&y);

    //pSymbol1->SetOrigin(x+0.2,y+0.2);

    //pSymbol1->Angle=45*3.1415926/180.0;

    //

    /*CString strSourceDoc;

    if(pSymbol1->OLEType==SolidEdgeFramework:Smiley SurprisedLEInsertionTypeConstant::igOLELinked)

    {

        strSourceDoc=pSymbol1->SourceDoc.Detach();

        pSymbol1->DoVerb(SolidEdgeConstants:Smiley FrustratedtandardOLEVerbConstants::igOLEOpen);

    }*/

 

    SolidEdgeDraft::ModelLinksPtr pModelLinks;

    SolidEdgeDraft::ModelLinkPtr pModelLink;

    SolidEdgeDraft:Smiley Very HappyrawingViewsPtr pDrawingViews;

    SolidEdgeDraft:Smiley Very HappyrawingViewPtr pDrawingView,pDrawingView1;

 

    pModelLinks=pDraftDoc->ModelLinks;

    pModelLink=pModelLinks->Add("C:\\1.par");

    pDrawingViews=pSheet->DrawingViews;

    pDrawingView=pDrawingViews->AddPartView(pModelLink,SolidEdgeDraft::ViewOrientationConstants::igFrontView,

        1,0.1,0.1,SolidEdgeDraft:Smiley TongueartDrawingViewTypeConstants::sePartDesignedView );

    pDrawingView->Caption="My View";

    pDrawingView->DisplayCaption=VARIANT_TRUE;

 

    pDrawingView1=pDrawingViews->AddByFold(pDrawingView,SolidEdgeDraft::FoldTypeConstants::igFoldRight,0.5,0.2);

 

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