Creating projected views from base views

Top  Previous  Next

This page shows how to put in two base views. If you want to create a projected view from the first base view, the last part of the code becomes:

 

    // Now create our two views, a base and a projected view

    CComVariant varEmpty ;

    CComPtr<Point2d> pPt1; 

    pTrGeom->CreatePoint2d(10.0,10.0,&pPt1);  

 

    // The base view...

    CComPtr<DrawingView> pBaseView1  ;

    pViews->AddBaseView (pDoc, // what to show

                         pPt1, // corner of view

                         kViewScale1, // size, scale, of view

                         kBottomViewOrientation, // from where to view the doc

                         kHiddenLineDrawingViewStyle, // DrawingViewStyleEnum

                         L"10-10", // name of created view

                         varEmpty,varEmpty, // unused in this case

                         &pBaseView1) ; // the created view

 

    // In this case we create a projected view which has the base view as 

    // the parent and which is to the right of the parent. Inventor itself will

    // sort out the projection. (compare pPt1 and pPt2)

    CComPtr<Point2d> pPt2; 

    pTrGeom->CreatePoint2d(15.0,10.0,&pPt2);  

    CComPtr<DrawingView> pProjectedView  ;

    pViews->AddProjectedView (pBaseView1, // parent view

                              pPt2,       // center of projected view

                              kHiddenLineDrawingViewStyle,

                              varEmpty,          // empty, so same scale as parent 

                              &pProjectedView) ; // resulting projected view

 

 

Here is a BaseView and a ProjectedView:

 

BaseView-ProjectedView

Text, images and diagrams © 2021 Owen F. Ransen. All rights reserved. (But copy the source code as much as you want!)