Hide Table of Contents
AdvancedHole Method (IFeatureManager)

Creates an Advanced Hole feature.

.NET Syntax

Visual Basic (Declaration) 
Function AdvancedHole( _
   ByVal AdvancedHoleNearElementArray As System.Object, _
   ByVal AdvancedHoleFarElementArray As System.Object, _
   ByVal UseBaselineDimensions As System.Boolean, _
   ByVal IsCustomCallout As System.Boolean, _
   ByRef ResultArray As System.Object _
) As Feature
Visual Basic (Usage) 
Dim instance As IFeatureManager
Dim AdvancedHoleNearElementArray As System.Object
Dim AdvancedHoleFarElementArray As System.Object
Dim UseBaselineDimensions As System.Boolean
Dim IsCustomCallout As System.Boolean
Dim ResultArray As System.Object
Dim value As Feature
value = instance.AdvancedHole(AdvancedHoleNearElementArray, AdvancedHoleFarElementArray, UseBaselineDimensions, IsCustomCallout, ResultArray)
Feature AdvancedHole( 
   System.object AdvancedHoleNearElementArray,
   System.object AdvancedHoleFarElementArray,
   System.bool UseBaselineDimensions,
   System.bool IsCustomCallout,
   out System.object ResultArray
Feature^ AdvancedHole( 
&   System.Object^ AdvancedHoleNearElementArray,
&   System.Object^ AdvancedHoleFarElementArray,
&   System.bool UseBaselineDimensions,
&   System.bool IsCustomCallout,
&   [Out] System.Object^ ResultArray


Array of near side hole data objects (see Remarks)
Array of far side hole data objects (see Remarks)
True to use baseline dimensions, false to not (see Remarks)
True to customize the hole callout, false to use a default hole callout (see Remarks)
Array of result codes as defined in swAdvancedHoleResults_e (see Remarks)

Return Value

IFeature; Nothing or null if this method results in an invalid geometry condition (see Remarks)



The Advanced Hole feature:

  • is separate from the Hole Wizard functionality (see FeatureManager::HoleWizard5). 
  • consists of several hole elements, e.g., counterbore, countersink, straight, and tapered tap, that are stacked from the near and far side faces inward. The near and far side stacks, combined, form the Advanced Hole.
  • can be added only to parts at this time.

AdvancedHoleNearElementArray and AdvancedHoleFarElementArray each contain one or more hole type-specific objects in order as they stack from the near and far side faces:

The hole type-specific interfaces above extend the parent interface, IAdvancedHoleElementData, which you use to set general Advanced Hole properties.

UseBaseLineDimensions controls which hole type-specific properties are valid. See IAdvancedHoleFeatureData::UseBaselineDimensions.

IsCustomCallout set to true allows you to set a custom callout string for individual hole elements using IAdvancedHoleElementData::CalloutString.

ResultArray contains a return code for each element in AdvancedHoleNearElementArray and AdvancedHoleFarElementArray. It is possible for this method to fail to create an advanced hole, even though ResultArray contains all success result codes. If the individual hole elements all combine to produce invalid geometry (e.g., a disjoint body or a self-intersecting face) or if incorrect near or far side faces are selected, then this method returns Nothing or null.

To create an Advanced Hole feature, follow the examples which do the following:

  1. Call IModelDocExtension::SelectByRay to select the near side (Mark = 256) and far side (Mark = 512) faces of the Advanced Hole. You must select these faces by location, so do not use IEntity::Select4.
  2. Call IModelDocExtension::CreateAdvancedHoleElementData to create an AdvancedHoleElementData object.
  3. Set the general Advanced Hole properties using the AdvancedHoleElementData object.
  4. Cast the AdvancedHoleElementData object using one of the hole type-specific interfaces.
  5. Set the specific Advanced Hole properties using the hole type-specific object.
  6. Repeat steps 2 - 5 for each hole element you want to add to the near and far side stacks of the Advanced Hole.
  7. Create near and far side arrays of the hole type-specific objects in stacking order from each face inward. The innermost elements of each stack should match to create a contiguous hole that extends from near side face to far side face.
  8. Pass the near and far side arrays to IFeatureManager::AdvancedHole to create the Advanced Hole.
  9. Delete the defining Advanced Hole sketch point and call ISketchManager::CreatePoint one or more times to insert the Advanced Hole in multiple locations.

To edit an Advanced Hole feature, call IFeature::GetDefinition to access IAdvancedHoleFeatureData. See Accessing Selections that Define Features.


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:   AdvancedHole 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) 2019 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.