Hide Table of Contents
InsertGlobalBoundingBox Method (IFeatureManager)

Inserts a Bounding Box feature.

.NET Syntax

Visual Basic (Declaration) 
Function InsertGlobalBoundingBox( _
   ByVal BBoxType As System.Integer, _
   ByVal IncludeHiddenBodies As System.Boolean, _
   ByVal IncludeSurfaceBodies As System.Boolean, _
   ByRef Status As System.Integer _
) As System.Object
Visual Basic (Usage) 
Dim instance As IFeatureManager
Dim BBoxType As System.Integer
Dim IncludeHiddenBodies As System.Boolean
Dim IncludeSurfaceBodies As System.Boolean
Dim Status As System.Integer
Dim value As System.Object
value = instance.InsertGlobalBoundingBox(BBoxType, IncludeHiddenBodies, IncludeSurfaceBodies, Status)
System.object InsertGlobalBoundingBox( 
   System.int BBoxType,
   System.bool IncludeHiddenBodies,
   System.bool IncludeSurfaceBodies,
   out System.int Status
System.Object^ InsertGlobalBoundingBox( 
&   System.int BBoxType,
&   System.bool IncludeHiddenBodies,
&   System.bool IncludeSurfaceBodies,
&   [Out] System.int Status


Bounding Box fit type as defined in swGlobalBoundingBoxFitOptions_e (see Remarks)
True to include hidden bodies, false to not
True to include surfaces, false to not
Status as defined by swGlobalBoundingBoxResult_e

Return Value



Dim swApp As SldWorks.SldWorks
Dim Part As SldWorks.ModelDoc2
Dim boolstatus As Boolean
Dim longstatus As Long
Option Explicit
Sub main()

Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
    ' Display the Bounding Box sketch
boolstatus = Part.SetUserPreferenceToggle)swViewDispGlobalBBox, True)

Dim BoundingBox As SldWorks.Feature
Set BoundingBox = Part.FeatureManager.InsertGlobalBoundingBox(swBoundingBoxType_BestFit, True, False, longstatus)
    Part.ClearSelection2 True
    ' Hide the Bounding Box sketch
boolstatus = Part.SetUserPreferenceToggle)swViewDispGlobalBBox, False)
End Sub


If BBoxType is set to swGlobalBoundingBoxFitOptions_e.swBoundingBoxType_CustomPlane, then select a face or plane using IModelDocExtension::SelectByRay with TypeWanted set to swSelectType_e.swSelFACES before calling this method.

To display or hide the Bounding Box sketch, call IModelDoc2::SetUserPreferenceToggle to set swUserPreferenceToggle_e.swViewDispGlobalBBox to true or false, respectively.

After calling this method, use IModelDoc2::ClearSelection2 to clear the selection made when the Bounding Box is created.


See Also


SOLIDWORKS 2018 FCS, Revision Number 26.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

Subject:   Feedback on Help Topics
Page:   InsertGlobalBoundingBox Method (IFeatureManager)
*   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:


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

Web Help Content Version: API Help (English only) 2018 SP05

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.