Hide Table of Contents
InsertAnnotationView Method (IModelDocExtension)

Inserts an annotation view in this part or assembly document.

.NET Syntax

Visual Basic (Declaration) 
Function InsertAnnotationView( _
   ByVal AnnotationViewingDirection As System.Integer, _
   ByVal DirectionReference As System.Object, _
   ByVal FlipDirection As System.Boolean, _
   ByVal HorizontalDirectionReference As System.Object, _
   ByVal AngleMadeWithHorizontal As System.Integer _
) As AnnotationView
Visual Basic (Usage) 
Dim instance As IModelDocExtension
Dim AnnotationViewingDirection As System.Integer
Dim DirectionReference As System.Object
Dim FlipDirection As System.Boolean
Dim HorizontalDirectionReference As System.Object
Dim AngleMadeWithHorizontal As System.Integer
Dim value As AnnotationView
 
value = instance.InsertAnnotationView(AnnotationViewingDirection, DirectionReference, FlipDirection, HorizontalDirectionReference, AngleMadeWithHorizontal)
C# 
AnnotationView InsertAnnotationView( 
   System.int AnnotationViewingDirection,
   System.object DirectionReference,
   System.bool FlipDirection,
   System.object HorizontalDirectionReference,
   System.int AngleMadeWithHorizontal
)
C++/CLI 
AnnotationView^ InsertAnnotationView( 
&   System.int AnnotationViewingDirection,
&   System.Object^ DirectionReference,
&   System.bool FlipDirection,
&   System.Object^ HorizontalDirectionReference,
&   System.int AngleMadeWithHorizontal
) 

Parameters

AnnotationViewingDirection
Defined by either any swStandardViews_e enumerator or 0 for selection
DirectionReference
If 0 specified for AnnotationViewingDirection, then specifiy a face or plane to define the direction of the annotation view
FlipDirection

True to flip the annotation view in the opposite direction, false to not

HorizontalDirectionReference
An edge, sketch, or face
AngleMadeWithHorizontal
Angle (in degrees) with the specified HorizontalDirectionReference

Return Value

Newly inserted annotation view

Example

'VBA

'----------------------------------------------------------------------------

' Preconditions:

' 1. Open a SOLIDWORKS model file.

' 2. Select a face to define the direction of the annotation view.

' 3. Select an edge as a horizontal direction reference.

'

' Postconditions: Observe that a new annotation view is inserted at a 45 degree angle in reference to the face and edge.

'----------------------------------------------------------------------------

Dim swApp As SldWorks.SldWorks

Dim swModel As SldWorks.ModelDoc2

Dim swModExt As SldWorks.ModelDocExtension

Dim swSelMgr As SldWorks.SelectionMgr

Dim swFace As SldWorks.Face2

Dim swEdge As SldWorks.edge

Dim swAnnoView As SldWorks.AnnotationView

Dim i As Integer

Sub main()

     Set swApp = Application.SldWorks

     Set swModel = swApp.ActiveDoc

     Set swModExt = swModel.Extension

     Set swSelMgr = swModel.SelectionManager

     For i = 0 To swSelMgr.GetSelectedObjectCount2(-1) - 1

         If swSelMgr.GetSelectedObjectType3(i + 1, -1) = swSelFACES Then

             Set swFace = swSelMgr.GetSelectedObject6(i + 1, -1)

         End If

         If swSelMgr.GetSelectedObjectType3(i + 1, -1) = swSelEDGES Then

             Set swEdge = swSelMgr.GetSelectedObject6(i + 1, -1)

         End If

     Next i

   

     Set annoView = swModExt.InsertAnnotationView(0, Nothing, False, swEdge, 45)

     swModel.EditRebuild3

End Sub

 

 

See Also

Availability

SOLIDWORKS 2008 FCS, Revision Number 16.0


Provide feedback on this topic

SOLIDWORKS welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Use the form below to send your comments and suggestions about this topic directly to our documentation team. The documentation team cannot answer technical support questions. Click here for information about technical support.

* Required

 
*Email:  
Subject:   Feedback on Help Topics
Page:   InsertAnnotationView Method (IModelDocExtension)
*Comment:  
*   I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:

x

We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

 Never show this message again
x

Web Help Content Version: API Help (English only) 2025 SP2

To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.