Reply

Create principal view

Hi. How can I create principal view in code (see image below)?

 

Origin image I created by code:

ModelLinks modelLinks = _draftDoc.ModelLinks;
ModelLink modelLink = modelLinks.Add(_fullName);
DrawingViews drawingViews = _sheet.DrawingViews;

DrawingView drawingView = drawingViews.AddPartView(
    From: modelLink,
    Orientation: orientation,
    Scale: scale,
    x: StUtils.MillimetersToMeters(x),
    y: StUtils.MillimetersToMeters(y),
    ViewType: PartDrawingViewTypeConstants.sePartDesignedView);

drawingView.CaptionDefinitionTextPrimary = caption;

How to create a second view (see figure below)? Which method to invoke for an object drawingViews.AddXXXXX ?

 

2 REPLIES

Re: Create principal view

Hi,

 

I can't currently verify, but in previous releases for ViewType the following misspelled constant had to be used:

 

SolidEdgeDraft.DrawingViewTypeConstants.igPrincipleView

 

 

Kind regards,
Wolfgang Kunert - www.wksyspro.de

Re: Create principal view

Hi,

 

just verified what to do.

If you set the orientation to igTopView the resulting DrawingView will get the (readonly) DrawingViewType igPrincipleView.

 

Kind regards,
Wolfgang Kunert - www.wksyspro.de